- Joined
- Feb 4, 2012
- Messages
- 4
- Reaction score
- 0
- Points
- 1
hey guys, I was working on setting up a geeklet for my facebook news feeds.
heres what i am doing
1. I am running a script from crontab every five min.
heres the script. all im doing is removing html tags and tabs from the output of curl.
localhost:geeklets root# cat extrct_fb.sh
#!/bin/ksh
GEEKHOME=/Users/spankincubus/Documents/geeklets
FBLOG=${GEEKHOME}/sajal.txt
curl --silent "http://www.gencolee.com/fb/newsfeedrss.php?u=540891642&s=9f8513cc5b1c6472419e24.0-540891642"|awk '/pubDate/,/\/description/'|sed 's/^I//g'|sed 's/<[^>]*>//g'|sed 's/\]\]>//g' |sed '/http/d;s/ //g'|sed 's/^[^>]*0800$//g'|tr -d " "|fold|cat -s > ${FBLOG}
if [[ $? -eq 0 ]]; then
echo "FB logs written!"
else
exit 1
fi
The output of this script has no spaces between words:
localhost:geeklets root# cat sajal.txt
1RajeshKumar
AgneepathEffect♥
Beta:Mandwa
AlexisMcDaniel
Howaboutbeforewegetwastedtonight,wegetwastedtonight?Pregame.
AshwathGowdaDanihalli
PartyingWithMadhu,Harish,pavaninMalleswaram,Banglore
Mashable
WhichChromepluginswouldyourecommend?
Domino'sPizza
Here’sasecrettoawinningpartyonSundaylaceaDomino’spre-orderTODAY!
BUT
when i run the curl command from the command line the output(in italics) is flawless (spaces betn words are intact):
localhost:geeklets root# curl --silent "http://www.gencolee.com/fb/newsfeedrss.php?u=540891642&s=9f8513cc5b1c647612419e24.0-540891642"|awk '/pubDate/,/\/description/'|sed 's/ //g'|sed 's/<[^>]*>//g'|sed 's/\]\]>//g' |sed '/http/d;s/ //g'|sed 's/^[^>]*0800$//g'|tr -d " "|fold|cat -s
1Ashwath Gowda Danihalli
Partying With Madhu , Harish , pavan in Malleswaram,Banglore
Mashable
Which Chrome plugins would you recommend?
Domino's Pizza
Here’s a secret to a winning party on Sunday: place a Domino’s pre-order TODAY!
Best Buy
Take the hassle out of moving your data from your old PC to that shiny new lapto
p.
Mashable
Will you be watching the streaming version of Super Bowl XLVI online?
Sierra Mist
Superbowl party tomorrow? Try out these festive cocktails for a perfect way to w
ash down those game day snacks!
Best Buy
Thank You to Dreams Come True for choosing Best Buy to fulfill Zowanda's wish fo
r electronics!
How can i get the same output from cronning script !
heres what i am doing
1. I am running a script from crontab every five min.
heres the script. all im doing is removing html tags and tabs from the output of curl.
localhost:geeklets root# cat extrct_fb.sh
#!/bin/ksh
GEEKHOME=/Users/spankincubus/Documents/geeklets
FBLOG=${GEEKHOME}/sajal.txt
curl --silent "http://www.gencolee.com/fb/newsfeedrss.php?u=540891642&s=9f8513cc5b1c6472419e24.0-540891642"|awk '/pubDate/,/\/description/'|sed 's/^I//g'|sed 's/<[^>]*>//g'|sed 's/\]\]>//g' |sed '/http/d;s/ //g'|sed 's/^[^>]*0800$//g'|tr -d " "|fold|cat -s > ${FBLOG}
if [[ $? -eq 0 ]]; then
echo "FB logs written!"
else
exit 1
fi
The output of this script has no spaces between words:
localhost:geeklets root# cat sajal.txt
1RajeshKumar
AgneepathEffect♥
Beta:Mandwa
AlexisMcDaniel
Howaboutbeforewegetwastedtonight,wegetwastedtonight?Pregame.
AshwathGowdaDanihalli
PartyingWithMadhu,Harish,pavaninMalleswaram,Banglore
Mashable
WhichChromepluginswouldyourecommend?
Domino'sPizza
Here’sasecrettoawinningpartyonSundaylaceaDomino’spre-orderTODAY!
BUT
when i run the curl command from the command line the output(in italics) is flawless (spaces betn words are intact):
localhost:geeklets root# curl --silent "http://www.gencolee.com/fb/newsfeedrss.php?u=540891642&s=9f8513cc5b1c647612419e24.0-540891642"|awk '/pubDate/,/\/description/'|sed 's/ //g'|sed 's/<[^>]*>//g'|sed 's/\]\]>//g' |sed '/http/d;s/ //g'|sed 's/^[^>]*0800$//g'|tr -d " "|fold|cat -s
1Ashwath Gowda Danihalli
Partying With Madhu , Harish , pavan in Malleswaram,Banglore
Mashable
Which Chrome plugins would you recommend?
Domino's Pizza
Here’s a secret to a winning party on Sunday: place a Domino’s pre-order TODAY!
Best Buy
Take the hassle out of moving your data from your old PC to that shiny new lapto
p.
Mashable
Will you be watching the streaming version of Super Bowl XLVI online?
Sierra Mist
Superbowl party tomorrow? Try out these festive cocktails for a perfect way to w
ash down those game day snacks!
Best Buy
Thank You to Dreams Come True for choosing Best Buy to fulfill Zowanda's wish fo
r electronics!
How can i get the same output from cronning script !