8 Replies - 242 Views - Last Post: 27 July 2012 - 02:15 PM Rate Topic: -----

#1 IndiaJonathan  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 12
  • Joined: 27-July 12

How do I send an rss request?

Posted 27 July 2012 - 12:58 PM

Hi! I am needing to send a request, like
http://weather.yahoo...strss?w=2502265
to the yahoo weather api info here (http://developer.yahoo.com/weather/) and output something similar to the code below, what do I use to send the request?
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<title>Yahoo! Weather - Sunnyvale, CA</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Sunnyvale__CA/*http://weather.yahoo.com/forecast/USCA1116_f.html</link>
<description>Yahoo! Weather for Sunnyvale, CA</description>
<language>en-us</language>
<lastBuildDate>Fri, 18 Dec 2009 9:38 am PST</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="Sunnyvale" region="CA" country="United States"/>
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
<yweather:wind chill="50" direction="0" speed="0" />
<yweather:atmosphere humidity="94" visibility="3" pressure="30.27" rising="1" />
<yweather:astronomy sunrise="7:17 am" sunset="4:52 pm"/>
<image>
<title>Yahoo! Weather</title>
<width>142</width>
<height>18</height>
<link>http://weather.yahoo.com</link>
<url>http://l.yimg.com/a/i/us/nws/th/main_142b.gif</url>
</image>
<item>
<title>Conditions for Sunnyvale, CA at 9:38 am PST</title>
<geo:lat>37.37</geo:lat>
<geo:long>-122.04</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Sunnyvale__CA/*http://weather.yahoo.com/forecast/USCA1116_f.html</link>
<pubDate>Fri, 18 Dec 2009 9:38 am PST</pubDate>
<yweather:condition text="Mostly Cloudy" code="28" temp="50" date="Fri, 18 Dec 2009 9:38 am PST" />
<description><![CDATA[
<img src="http://l.yimg.com/a/i/us/we/52/28.gif"/><br />
<b>Current Conditions:</b><br />
Mostly Cloudy, 50 F<BR />
<BR /><b>Forecast:</b><BR />
Fri - Partly Cloudy. High: 62 Low: 49<br />
Sat - Partly Cloudy. High: 65 Low: 49<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Sunnyvale__CA/*http://weather.yahoo.com/forecast/USCA1116_f.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
]]></description>
<yweather:forecast day="Fri" date="18 Dec 2009" low="49" high="62" text="Partly Cloudy" code="30" />
<yweather:forecast day="Sat" date="19 Dec 2009" low="49" high="65" text="Partly Cloudy" code="30" />
<guid isPermaLink="false">USCA1116_2009_12_18_9_38_PST</guid>
</item>
</channel>
</rss>



and then I can take over the rest to output the data into variables and such, thanks

Is This A Good Question/Topic? 0
  • +

Replies To: How do I send an rss request?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5667
  • View blog
  • Posts: 22,509
  • Joined: 23-August 08

Re: How do I send an rss request?

Posted 27 July 2012 - 01:03 PM

Maybe this might help.
Was This Post Helpful? 0
  • +
  • -

#3 IndiaJonathan  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 12
  • Joined: 27-July 12

Re: How do I send an rss request?

Posted 27 July 2012 - 01:07 PM

It does help, thank you, but there are no comments QQ did you use devc++? Or visual?
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5667
  • View blog
  • Posts: 22,509
  • Joined: 23-August 08

Re: How do I send an rss request?

Posted 27 July 2012 - 01:13 PM

Neither; I used the command line in Mac OS X. If you're looking for a full tutorial, there isn't one.

The overall answer to your question is you can use an HTTP library like cURL to make the request.
Was This Post Helpful? 0
  • +
  • -

#5 IndiaJonathan  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 12
  • Joined: 27-July 12

Re: How do I send an rss request?

Posted 27 July 2012 - 01:16 PM

Thanks, but I do not use Mac OS X, got anything for powershell or cmd? I could make a batch file maybe.
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 1896
  • View blog
  • Posts: 5,687
  • Joined: 05-May 12

Re: How do I send an rss request?

Posted 27 July 2012 - 01:33 PM

You can download curl.exe and make a CMD script.

I'm not sure, but with PowerShell, I think you have access to the HttpWebRequest CLR class and send your request that way.
Was This Post Helpful? 1
  • +
  • -

#7 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5667
  • View blog
  • Posts: 22,509
  • Joined: 23-August 08

Re: How do I send an rss request?

Posted 27 July 2012 - 01:38 PM

Yeah, if you don't have to use C++ for this, a higher-level language (like a scripting language) would be a better choice.
Was This Post Helpful? 0
  • +
  • -

#8 IndiaJonathan  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 12
  • Joined: 27-July 12

Re: How do I send an rss request?

Posted 27 July 2012 - 01:50 PM

Thank you! that has helped very much! One last question, if I use
curl http://google.com
to access the website, it outputs it to the cmd, any help with outputting the info to a text document? Just that part, nothing else.
Was This Post Helpful? 0
  • +
  • -

#9 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 919
  • View blog
  • Posts: 6,442
  • Joined: 07-September 06

Re: How do I send an rss request?

Posted 27 July 2012 - 02:15 PM

You should be able to redirect the output:

curl http://google.com > google.html


Something like that should work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1