Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get temperature from yahoo.

Status
Not open for further replies.

zebra1057

Technical User
Mar 31, 2001
39
US
I don't know if this is the right board for this question.

I'm making a website. I would like to get the current temperature of Los Angeles and show it in my main page.

It will say : Los Angeles current temperature is X
where
X is a variable that I will get from yahoo.
I'm trying to avoid a link with yahoo that will show a yahoo
page.

In other words, we're getting fresh info from yahoo whenever
the main page is requested but would not show that it is coming from yahoo or the weather channel.

Thanks in advance,

roland
 
ugly, but does the job (unless they change their page layout)

<%@language=&quot;vbscript&quot; enablesessionstate=&quot;false&quot;%>
<%dim obj_xmlhttp
set obj_xmlhttp = Server.CreateObject(&quot;Microsoft.XMLHTTP&quot;)
obj_xmlhttp.open &quot;get&quot;, &quot; false
obj_xmlhttp.setRequestHeader &quot;Content-type:&quot;, &quot;text/html&quot;
obj_xmlhttp.send
dim str_yahoo
dim str_start, str_end, lng_start
str_start = &quot;<tr><td align=center nowrap><font size=+2 face=Arial><b>&quot;
str_end = &quot;</b>&quot;
str_yahoo = obj_xmlhttp.responsetext
lng_start = instr(str_yahoo, str_start)
lng_start = lng_start+len(str_start)
str_yahoo = mid(str_yahoo, lng_start, instr(lng_start, str_yahoo, str_end)-lng_start)
set obj_xmlhttp = nothing
%><html><body>Current temp in LA: <%=str_yahoo%></body></html> codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
Nice, it's always fun to see someone else misusing the xmlhttp object :)
-Tarwn
[I'm not the only one! :p] ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top