Sensex Figure using a Linux Command
Tagged with: cli, command, curl, fetch, grep, Linux, Perl, sensex
Thursday, October 18th, 2007 10:59 PM
This one command will fetch and display the latest sensex figure in Linux. This command basically downloads a page, locates a specific line, and then extract just the necessary portion from it. I am sure you could find other uses for this method.
curl -s "http://money.rediff.com/money/jsp/markets_home.jsp" |grep ''|head -n1|perl -pe 's/^.+\">([\d\,\.]+)<\/TD>.+$/\1/i;'
No Comments »
Word Meaning from Linux Command Line
Tagged with: command, curl, dict, dictionary, Linux, meaning, word
Tuesday, September 25th, 2007 07:49 AM
Find the meaning of a word from dict using curl. System must be online for this to work.
curl dict://dict.org/d:word
[tags]dict,word,meaning,dictionary,curl,linux,command[/tags]
No Comments »
Using PHP’s Curl functions behind a Proxy
Tagged with: Code, curl, godaddy, PHP, proxy
Wednesday, March 7th, 2007 06:38 PM
Using PHP’s Curl functions even if the net is accessible only thru a proxy. This is the only way curl can be used if you use GoDaddy’s hosting.
<?php
$ch = curl_init("http://rss.news.yahoo.com/rss/topstories");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, "http://192.168.0.15:80");
curl_setopt($ch, CURLOPT_PROXYPORT, 80);
//curl_setopt ($ch, CURLOPT_PROXYUSERPWD, "username:password");
$data = curl_exec ($ch);
curl_close($ch);
print $data;
?>
No Comments »