Favourite count


SUBMITTED BY: Guest

DATE: March 27, 2013, 5:40 a.m.

FORMAT: PHP

SIZE: 1.6 kB

HITS: 1096

  1. $source .= ", " . $status->place->name . ", " . $status->place->country;
  2. ...
  3. $source .= ", in reply to <a href='status/{$status->in_reply_to_status_id_str}'>{$status->in_reply_to_screen_name}</a>";
  4. ...
  5. /*Ini yang dirubah, adaptasi dari kode lama*/
  6. $source .= ", <a href='retweeted_by/{$status->id}'>retweeted ";
  7. switch($status->retweet_count) {
  8. case(1) : $source .= "once</a>"; break;
  9. case(2) : $source .= "twice</a>"; break;
  10. // Twitter are uncapping the retweet count (https://dev.twitter.com/discussions/5129) will need to correctly format large numbers
  11. case(is_int($status->retweet_count)) : $source .= number_format($status->retweet_count) . " times</a>"; break;
  12. // Legacy for old tweets where the retweet count is a string (usually "100+")
  13. default : $source .= $status->retweet_count . " times</a>";
  14. }
  15. ...
  16. /*Bagian ini juga adaptasi dari kode lama*/
  17. if($status->favorite_count) {
  18. $source .= ", favourited ";
  19. switch($status->favorite_count) {
  20. case(1) : $source .= "once"; break;
  21. case(2) : $source .= "twice"; break;
  22. case(is_int($status->favorite_count)) : $source .= number_format($status->favorite_count) . " times</a>"; break;
  23. default : $source .= $status->favorite_count. " times</a>";
  24. }
  25. }
  26. ...
  27. $html = "<b><a href='user/{$status->from->screen_name}'>{$status->from->screen_name}</a></b> $actions $link{$retweeted}<br />{$text}<br />$media<span class='from'>$source</span>";

comments powered by Disqus