Friday, December 13, 2013

Disable F5 keyboard key using jquery

// Load latest jquery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

// Script

<script type="text/javascript">
function disable_f5(e)
{
  if ((e.which || e.keyCode) == 116)
  {
      e.preventDefault();
  }
}

$(document).ready(function(){
    $(document).bind("keydown", disable_f5);   
});
</script>

Monday, December 02, 2013

Get Facebook Share ,Like , Comments Count

Just Run the follwing Code , Please assign your url in $source_url
 
<?php
 
$source_url = "http://www.flightpodcast.com/episode-6-john-bartels-qantas-qf30";
$url = "http://api.facebook.com/restserver.php?method=links.getStats&urls=".urlencode($source_url);
$xml = file_get_contents($url);
$xml = simplexml_load_string($xml);

echo "Share --- ".$shares = $xml->link_stat->share_count;
echo "<br/>";

echo "Like --- ".$likes = $xml->link_stat->like_count;
echo "<br/>";

echo "Comments ---".$comments = $xml->link_stat->comment_count; 
echo "<br/>";

echo "Total --- ".$total = $xml->link_stat->total_count;
echo "<br/>";