How to create RSS feed in Java?

How do I create a very specific RSS feed from a webpage?

  • I want to set up a RSS feed that spits out the wind speed ONLY from http://www.weatheroffice.gc.ca/city/pages/nl-17_metric_e.html. I’ve tried using Yahoo Pipes to create a more focused feed but I’m not having luck. I’ve tried “fetch page data” but I always get a blank feed at the end of the pipe. I’m not married to using Yahoo Pipes. If you can suggest another service that is easier to use, I’ll take it. But Pipes is the only service I can find which suggests it could gather very specific data from a page/rss feed.

  • Answer:

    http://pipes.yahoo.com/pipes/pipe.info?_id=c96713ea3671217321e7a2b34e25bc99 Feel free to clone/edit. Basically it just strips out everything but the wind from the feed jsturgill posted, then changes the title to show the time.

Brodiggitty at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

Hi Brody! The web service https://ifttt.com/ (If This Then That) is designed for stuff like this. You can use it to, for example, automatically tweet something when a certain keyword shows up in an RSS feed. But I'm not sure it will work for this situation because the "Wind" keyword is buried in the middle of a bunch of other data, and I don't know how to use IFTTT to extract just the wind speed data from the RSS content. But IFTTT might be a good place to start.

oulipian

You mean the current conditions wind entry from http://www.weatheroffice.gc.ca/rss/city/nl-17_e.xml? Is this a thing you want to display embedded on another website, or log in a database at regular intervals, or what?

jsturgill

This seems like anhttp://www.perlmonks.org/?node_id=542341. What are you actually trying to do once you have the RSS feed? We may be able to offer better solutions based on what your end goal is, instead of just this specific implementation option.

rockindata

My plan is to link the data to a twitter account using twitterfeed. I want it to be automatic, every hour or two hours or whatever...

Brodiggitty

Thanks Oulipan - This is almost what I want. I was actually looking to do this for Wreckhouse's weather. Just realized I posted the wrong EC weather page in my question. IFTTT has weather for many areas but not Wreckhouse. I bet if I drill down enough in its options, I may find a way to do this.

Brodiggitty

If IFTTT doesn't give you the control you need, you could set up a cron job (linux) or schedule a task (windows) to run a script (shell, perl, php, python, ruby, powershell) that fetches the page, retrieves the wind speed with a regular expression, then uses the twitter API to create the tweet. The important key words are in bold. Use the above when you talk to a friend who's good at that sort of thing, or learn it yourself in a day or two and put it together.

jsturgill

the jam

Oh, cool. Yahoo Pipes has regexes? That's a Neat Thing.

jsturgill

Thanks you zsazsa! That is exactly what I want. Just going to clone and edit the location slightly. Thanks everyone. I sort of know Regexes is what I needed to learn but to busy/lazy to learn the programming.

Brodiggitty

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.