Put solat time in conky|Pasang jadual solat di conky
If you’re linux user and want to put solat time in your concy.. just do the following step. I make this code a few week ago because most of my time is in front of computer. So it would be easy if I put this solat time in the place that I can easily to see.
1. create a php file name solat.php and put it in your webroot directory. Copy this code and paste in your solat.php . This code will get solat timetable from e-solat.gov.my . You can change url get parameter with your own need. Please refer to http://www.e-solat.gov.my/ for more detail.
$data = file_get_contents('http://www.e-solat.gov.my/solat.php?kod=SGR03 & lang=BM&url=http://google.com');
$data = strip_tags($data,'<table><tr><td></td></tr></table>');
$data = str_replace(" ","",$data);
$dom = new DOMDocument();
$dom->prevservWhiteSpace = false;
$dom->loadHTML($data);
$trs = $dom->getElementsByTagName('tr');
foreach( $trs as $tr){
$td = $tr->getElementsByTagName('td');
$result = array();
foreach($td as $row){
$result[] = trim($row->nodeValue);
}
$results[] = $result;
}
echo $results[5][0] . ' ' .$results[5][1] . "n";
echo ' '. $results[6][0] . ' ' .$results[6][1] . "n";
echo ' '. $results[7][0] . ' ' .$results[7][1] . "n";
echo ' '. $results[8][0] . ' ' .$results[8][1] . "n";
echo ' '. $results[9][0] . ' ' .$results[9][1] . "n";
echo ' '. $results[10][0] . ' ' .$results[10][1] . "n";
echo ' '. $results[11][0] . ' ' .$results[11][1] . "n";
2. create shell script solat.sh and put into your concy script folder. Copy and paste this code inside solat.sh
URI=http://localhost/rnd/solat/solat.php EXEC="/usr/bin/curl -s" $EXEC $URI
[lang_en-us]Please change URL to your own. Usually http://localhost/solat.php if you put solat.php script inside your webroot directory
3. Edit your .concyrc file and add this code
${font Radio Space:size=14}Solat Time
${font}
${texeci 900 ./scripts/solat.sh}



Mario Auclair 9:03 pm on December 15, 2010 Permalink |
Fantastic blog! I really love how it?s easy on my eyes and also the information are well written. I am wondering how I could be notified whenever a new post has been made. I have subscribed to your rss feed which ought to do the trick! Have a nice day!
Simple JAKIM esolat wrapper 11:33 am on December 17, 2010 Permalink |
[...] you’re linux user, maybe this post will help you to put solat time in conky [...]
Simple JAKIM esolat wrapper « system reboot! 2:38 pm on March 29, 2012 Permalink |
[...] http://api.ibnuyahya.com/solat.php.txtIf you’re linux user, maybe this post will help you to put solat time in conky About ibnuyahyaIbnuyahya has written 100 post in this blog.Ibnuyahya merupakan seorang software [...]