January 29, 2010

Categories:

cron, rss, facebook, status updates

Downloading a Facebook "Page" feed via Wget

So today i had to set up some Cron jobs to download a few feeds from various websites. I built a Social networking timeline on a site we are about to deploy here at Kyan and didnt want to hit the individual websites directly every couple of minutes in order to acquire the data.

To overcome this i decided that setting up cron jobs to download the feeds would be a more reliable method. This way our own site would not be affected by any downtime experienced by any of the sites who were providing our feeds.

I used the wget tool to download the feeds but found i was unable to download the Facebook feed i wanted. An error was returned and i checked out the page which showed that my browser wasnt supported. Fortunately wget will allow you to supply a user-agent string with your command in order to force a download in this scenario:

wget --user-agent="some user agent string" "download link"

For added sugar, you can also rename the file your downloading with wget too:

wget -O some_file_name.ext "download link"

Perfect.

Comments

hey anyway that i can do this with chrome os? when i go to paste the user agent it sends it as a command instead of letting me finish lol

...uttered by Stephen on August 10, 2011 01:59AM

oops i got it i messed up --user-agent for got the hyphen as well as " user agent ..blah blah..:" lol
thanks man nice job keep up the good work

...uttered by Stephen on August 10, 2011 02:06AM

Please leave your comment...

11
likes

2
comments