Does anyone check the domain of an email address as part of their verification steps? eg. Confirm that gmail.com exists if the user specified [email protected] as their address.
I am trying to return the duration of the video but am having trouble.
#YOUTUBE FEED
#download the file:
file = urllib2.urlopen('http://gdata.youtube.com/feeds/api/videos/2s0vk2wEMtA')
#convert to string:
data = file.read()
#close file because we dont need it anymore:
file.close()
#entire feed
root = etree.fromstring(data)
for entry in root:
for item in entry:
print item
When I print item, I see as the last element:
Element '{http://gdata.youtube.com/schemas/2007}duration' at 0x10c4fb7d0
But I don't know how to get the value from this. Any advice?
basically i want to extract keywords or words or tokens that are present in the webpage after removing the stopwords..please help if anybody knws how to do it..will be thankful to u...code in c# would be appreciable..seeking for replies..pls help
I have a PHP application that sends email using the pear Mail function. Unfortunately all my emails end up in the junk folder.
Can i get a checklist for things i should do to make sure my emails are recieved correctly.
Thank you
I have an IP address which I want to grab the last chunk of as an integer. So from "192.168.1.150" I'd get 150.
This is the code I'd concocted (I'm using C++/CLI), but somehow it feels rather clunky:
String^ ipString = "192.168.1.150";
int lastDot = ipString->LastIndexOf('.');
int lastSection = int::Parse(ipString->Substring(lastDot, ipString->Length-lastDot));
Is there a simpler way of doing this?
Please forgive my title, I really don't know how to phrase it better.
This isn't a school assignment or anything, but I realize it's a mostly academic question. But, what I've been struggling to do is parse 'math' text and come up with an answer.
For Example - I can figure out how to parse '5 + 5' or '3 * 5' - but I fail when I try to correctly chain operations together.
(5 + 5) * 3
It's mostly just bugging me that I can't figure it out. If anyone can point me in a direction, I'd really appreciate it.
validates_format_of :email,
:with => /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/,
:message => "is missing or invalid"
Please let me know where is the problem? Is regular expression is wrong?
An invalid character was found in text content.'.
Could not find prepared statement with handle 0.
sp_xml_removedocument: The value supplied for parameter number 1 is invalid.
Below is the xml that i am generating.
<NewDataSet>
<ControlManagementItems><ControlId>74</ControlId><Value>wqeqe</Value></ControlManagementItems>
<ControlManagementItems><ControlId>76</ControlId><Value>Yes</Value></ControlManagementItems>
<ControlManagementItems><ControlId>78</ControlId><Value>Consumer Core $100 infinite – Nov 2010</Value></ControlManagementItems>
<ControlManagementItems><ControlId>108</ControlId><Value>Samsung Galaxy S 16GB</Value></ControlManagementItems>
</NewDataSet>
This is a link in an HTML email.. Other links in this email work, but this one does not get recognized in a BlackBerry as a link, so you can't click on it. Does anyone know why that might be? Here's the markup for it:
<a title="Continue"
style="display: block; width:200px; border:1px solid #336699; text-align: center; padding-top:5px; padding-bottom:5px; font-size:14px; font-family: Arial, Sans-Serif; color:#336699; font-weight:bold; text-decoration: none;"
href="https://www.mydomain.com/mypage.aspx?id=8430650">Continue ››</a>
Hello everyone, I am trying to fetch xml file using jquery.post() method. My code is :
function getTitle()
{
jQuery.ajax({
type: "GET",
url: "https://spreadsheets.google.com/feeds/spreadsheets/private/full.txt",
dataType: "xml",
success: function(xml) {
var i=0;
$(xml).find('entry').each(function(){
if($(this).find('title').text().toString() == "Sample Spreadsheet"){
var href = $(this).find('link')[1].getAttribute('href').toString();
var url="https://spreadsheets.google.com/feeds/worksheets/" + href.split('=')[1] + "/private/full";
alert(href.split('=')[1]);
}
i++;
});
}
});
}
But, it is not giving me alert ! How do I solve ?
Hi,
Using the DTD validator here, I am informed that the following DTD is invalid.
<!ENTITY % text "(#PCDATA|L)*">
<!ELEMENT H (%text;)+>
<!ELEMENT L (#PCDATA)>
The error message is: "A '(' character or an element type is required within declaration of element type "H"." at line 2, column 22.
Can anyone please point out why it is invalid? The error message is not exactly very friendly to me. Thanks.
Hi
I am noob to parsers.I like to fetch specific data from a website I need to use parsers for that. Can anybody please tel me how to get started with parsers.What do I need to download?
Can anybody the code to fetch the data from a website using parsers in java.
Thanks in advance.
I've got a string that could be in one of two forms:
prefix=key=value (which could have any characters, including '=')
or
key=value
So I need to split it either on the first or second equals sign, based on a boolean that gets set elsewhere. I'm doing this:
if ($split_on_second) {
$parts = explode('=', $str, 3);
$key = $parts[0] . '=' . $parts[1];
$val = $parts[2];
} else {
$parts = explode('=', $str, 2);
$key = $parts[0];
$val = $parts[1];
}
Which should work, but feels inelegant. Got any better ideas in php? (I imagine there's a regex-ninja way to do it, but I'm not a regex-ninja.;-)
How in Java can I get list of all characters appearing in string, with number of their appearances ? Let's say we have a string "I am really busy right now" so I should get :
i-2, a-2, r-2, m-1 and so on.
I am trying to configure Hudson to sent an email if a build fails to the person who committed the broken build to the SVN.
Question
Is it possible to do this and if so how do I configure Hudson to do it?
I want to develop an application that will automatically send an email as soon as an image is captured by the camera.
can anybody suggest some ideas regarding this???
Can't believe how difficult this seems to be all I want to is to validate a user inout using javascript to make sure that it is an email address. But can't get it to work:
I am using:
//validates a regulaer expression
Utilities2.prototype.validateEmail = function(stringToValidateArg)
{
alert('about to check regexp');
var regExpPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
alert(regExpPattern.test(stringToValidateArg));
}
But this always returns false, any ideas why is it because of the regular expression?
More specifically I'm looking for something, perhaps an add-on for firefox, once enabled it logs all of this information as it's passed to and from the server. I'm doing some web scripting and this would be really handy.
If anyone is wondering specifically what I'm doing currently I'm trying to make a script to repost my craigslist ad every 2 days since I handle a few things on there. Might even go so far as to make a simple gui to manage the submissions.
I do suspect this goes against the ToS, for that reason I don't plan to release the code. Besides cl is already bad enough with spam, I'm not trying to contribute further to it, figured I'd say what I'm doing for the sake of being honest though. I don't have any bad intentions with this, just some things I've been trying to sell an ad for my pc repair business. I've been reposting some things for months now and so often I just forget to do it.
hi,
I'm trying to strip the version out of a package name using only Bash. I have one solution but I don't think that's the best one available, so I'd like to know if there's a better way to do it. by better I mean cleaner, easier to understand.
suppose I have the string "my-program-1.0" and I want only "my-program". my current solution is:
#!/bin/bash
PROGRAM_FULL="my-program-1.0"
INDEX_OF_LAST_CHARACTER=`awk '{print match($0, "[A-Za-z0-9]-[0-9]")} <<< $PROGRAM_FULL`
PROGRAM_NAME=`cut -c -$INDEX_OF_LAST_CHARACTER <<< $PROGRAM_FULL`
actually, the "package name" syntax is an RPM file name, if it matters.
thanks!
Hey guys,
(Not a native english speaker)
I'm doing a personal project in PHP in which I use the Simple HTML Parser to parse the HTML of a given URL and retrieve the first image in a DIV that have a specific ID or class (maincontent, content, main, wrapper, etc. - it's all in an array) and ignore ads. The goal is to take this image and make a thumbnail with it, pretty much like on Digg and others.
I thought everything was working fine until I tried my script with the website Snopes ("http://www.snopes.com/photos/animals/luckycoyote.asp" <- this page more exactly).
The source of the first image it gets is: " graphics/luckycoyote1.jpg ". So far, to correct this problem I created a little function that gets the domain name of the given URL and insert it before the IMG's source attribute. So for sites like Snopes.com, it gives me: "http://www.snopes.com/graphics/luckycoyote1.jpg" ... while the real URL for this image is "http://www.snopes.com*/photos/animals/graphics/luckycoyote1.jpg*" (or, more precisely: " http://graphics1.snopes.com/photos/animals/graphics/luckycoyote1.jpg " - note the subdomain here).
So my main question is: how can I externally/dynamically retrieve the full URL address of an image ("absolute path") when I am only given the "relative path"? I'm pretty sure this is possible, since when I paste the link in Facebook's "What are you doing?" field for example, it gives me the correct path to the image while on the website, the source of the image is only (example) "image/photo/example.jpg".
Thank you for your time.
After seeing several threads rubbishing the regexp method of finding a term to match within an HTML document, I've used the Simple HTML DOM PHP parser (http://simplehtmldom.sourceforge.net/) to get the bits of text I'm after, but I want to know if my code is optimal. It feels like I'm looping too many times. Is there a way to optimise the following loop?
//Get the HTML and look at the text nodes
$html = str_get_html($buffer);
//First we match the <body> tag as we don't want to change the <head> items
foreach($html->find('body') as $body) {
//Then we get the text nodes, rather than any HTML
foreach($body->find('text') as $text) {
//Then we match each term
foreach ($terms as $term) {
//Match to the terms within the text nodes
$text->outertext = str_replace($term, '<span class="highlight">'.$term.'</span>', $text->outertext);
}
}
}
For example, would it make a difference to determine check if I have any matches before I start the loop maybe?