Current Status for #TopSecretProject #WaktuSolat

1) @waktuSolatKL – Kuala Lumpur (17920 followers)
2) @waktuSolatPNG – Penang (238 followers)
3) @waktuSolatIPOH – Ipoh, Perak (387 followers)
4) @waktuSolatKTN – Kuantan, Pahang (186 followers)
5) @waktuSolatMLK – Melaka (233 followers)
6) @waktuSolatWPP – Putrajaya (85 followers)
7) @waktuSolatPLS – Perlis (51 followers)
8) @waktuSolatSBN – Seremban, Negeri Sembilan (137 followers)
9) @waktuSolatKBR – Kota Bharu, Kelantan (134 followers)
10) @waktuSolatKTRG – Kuala Terengganu (106 followers)
11) @waktuSolatASR – Alor Setar, Kedah (116 followers)
12) @waktuSolatJBR – Johor Bahru, Johor (97 followers)
13) @waktuSolatKKB – Kota Kinabalu, Sabah (21 followers)
14) @waktuSolatKCH – Kuching, Sarawak (305 followers)
15) @waktuSolatLKW – Langkawi (9 followers)
16) @waktuSolatMUR – Muar, Johor (28 followers)
17) @waktuSolatLBN – Labuan (9 followers)
18) @waktuSolatSAS – Shah Alam, Selangor (669 followers)
19) @waktuSolatMIR – Miri, Sarawak (49 followers)

Function checkTime()

Disebabkan ada yang bertanya pasal function checkTime() yang digunakan dalam #WaktuSolat, camni rupanya :-

[php]

function checkTime($currentTime, $startTime, $endTime){

// written 11/26/2006 by Patrick H. (patrickh@gmail.com)

//

// the time passed must meet all the below criteria to return 1 (true):

//

// – current hour needs to be equal or greater than start hour

// – current hour needs to be equal or less than end hour

// – current minute needs to be equal or greater than start minute (if current hour is ok)

// – current minute needs to be equal or less than end minute (if current hour is ok)

//

// if any of those checks does not pass, it will return 0 (false)

 

global $cHour;

global $cMin;

global $sHour;

global $sMin;

global $eHour;

global $eMin;

 

// break up current time

$now = explode(“:”,$currentTime);

$cHour = intval($now[0]); // current time – hour

$cMin = intval($now[1]); // current time – minute

 

// break up start time

$start = explode(“:”,$startTime);

$sHour = intval($start[0]); // start of range – hour

$sMin = intval($start[1]); // start of range – minute

 

// brek up end time

$end = explode(“:”,$endTime);

$eHour = intval($end[0]); // end of range – hour

$eMin = intval($end[1]); // end of range – minute

 

// this is the variable used to track the result of the checks

$pass = true;

 

if($sHour <= $eHour){

// the range is on the same day

 

// compare to the start hour

if($cHour < $sHour){

$pass = false;

}

 

// compare to the end hour

if($cHour > $eHour){

$pass = false;

}

 

// compare to the start min

if($cHour == $sHour){

if($cMin < $sMin){

$pass = false;

}

}

 

// compare to the end min

if($cHour == $eHour){

if($cMin > $eMin){

$pass = false;

}

}

 

} else {

// the range is overnight, so the logic is a little different

 

if( ($cHour < $sHour) && ($cHour > $eHour) ){

$pass = false;

}

 

// compare to the start min

if($cHour == $sHour){

if($cMin < $sMin){

$pass = false;

}

}

 

// compare to the end min

if($cHour == $eHour){

if($cMin > $eMin){

$pass = false;

}

}

 

}

 

// done with check, return the result

if($pass == false){

return 0; // failed

} else {

return 1; // passed

}

 

}

[/php]

Selamat mencuba!

#TopSecretProject – #WaktuSolat UPDATED!

The #TopSecretProject got updated! This time I’ve added 6 more new Twitter accounts for solat fardhu alert. The previous existing services already running & available to the public is as follows (along with the number of followers as of now) :-

  1. Kuala Lumpur – @WaktuSolatKL (1470 followers)
  2. Ipoh – @WaktuSolatIPOH (22 followers)
  3. Kuantan – @WaktuSolatKTN (18 followers)
  4. Melaka – @WaktuSolatMLK (13 followers)
  5. Pulau Pinang / Penang – @WaktuSolatPNG (20 followers)

And here’s the 6 new twitter accounts :-

  1. Wilayah Persekutuan Putrajaya – @WaktuSolatWPP
  2. Perlis – @WaktuSolatPLS
  3. Seremban, Negeri Sembilan – @WaktuSolatSBN
  4. Alor Setar, Kedah – @WaktuSolatASR
  5. Kota Bharu, Kelantan – @WaktuSolatKBR
  6. Kuala Terengganu, Terengganu – @WaktuSolatKTRG

More areas will be added later. Tweets will be sent out when it’s time for Subuh / Zuhur / Asar / Maghrib / Isyak (5 times a day alert). To start receiving alerts, please signup / login to your Twitter account, before following the twitter accounts for your area.

#TopSecretProject – Twitter Alert for Waktu Solat

Memperkenalkan the so-called #TopSecretProject lah. It’s actually a tweet alert which’ll send out tweets bila dah masuk waktu solat fardhu on daily basis. Data waktu solat fetched from JAKIM’s website http://www.e-solat.gov.my/.
It’s actually a simple PHP script connected to Twitter via OAuth, it’ll do a simple checking of current time against the data stored in MySQL database. In order to identify whether the current time is Subuh, Zuhur, etc, I did a checking based on range of time for each sets of solat fardhu using function CheckTime() written by Patrick H. (patrickh@gmail.com). Function can be found at his personal blog.

The idea is to setup twitter alerts for major towns in Malaysia. For now, I’ve started creating 5 twitter accounts to cover Kuala Lumpur, Melaka, Ipoh, Pulau Pinang, & Kuantan. From time to time, I’ll be adding the other areas as well.

Below is the list of covered areas (striked-through) & to be covered.

Feedbacks are welcomed.

  1. WP Kuala Lumpur
  2. Melaka
  3. Ipoh
  4. Pulau Pinang
  5. Kuantan
  6. Kuala Terengganu
  7. Kota Kinabalu
  8. Perlis
  9. Johor Bahru
  10. Kota Bharu
  11. Alor Setar
  12. Kuching
  13. Labuan
  14. Seremban

Credits to @raficyber & @dewmandew for their help.

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑