Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Monday, 22 April 2013

how to display Facebook Likes in Your Web-site / blog

Step 1: go to this link
https://developers.facebook.com/docs/reference/plugins/like/

Step 2:
Paste your fb page url


Step 3:
press get code button u ll get code preview like this

Step 4:
copy and Paste the code [html-5 given in above prev image]
in your web page
note: paste the given code before body tag
like
<html>
<head>
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=433000033432471";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="http://www.facebook.com/akblog28" data-send="true" data-width="450" data-show-faces="true"></div>
<head>
<body>
</html>
Step 5:
Click save and see your web page
note : this code will run only in Ftp server this code not supported to localhost like [wamp,lamp,mamp]

Step 6:
Finally u got output like this

Friday, 19 April 2013

Login with google


First go to
https://code.google.com/apis/console/?pli=1

you will get

do like this

After that create outh

please give details 

after that go to index.php 
########## Google Settings.. Client ID, Client Secret #############
$google_client_id  = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';  //give your client id
$google_client_secret  = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';    //give ur client secret id
$google_redirect_url  = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';    //give redirect url
$google_developer_key  = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';//give developer key


########## MySql details (Replace with yours) #############
$db_username = ""; //Database Username
$db_password = ""; //Database Password
$hostname = "localhost"; //Mysql Hostname
$db_name = ''; //Database Name
//please made change all info given above and use it !! 


Download

Login with facebook And twitter


In Dbconfig.php : 
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'dbusername');
define('DB_PASSWORD', 'dbpassword');
define('DB_DATABASE', 'databasename');
$connection = mysql_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD) or die(mysql_error());
$database = mysql_select_db(DB_DATABASE) or die(mysql_error());
?>


In fbconfig.php:

<?php
define('APP_ID', 'xxxxxxxxxxxxxxxxxx');//add your App id
define('APP_SECRET', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx');//add your App secret id
?>

in twconfig.php
<?php
define('YOUR_CONSUMER_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxx');//add your twitter consumer key
define('YOUR_CONSUMER_SECRET', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');//add your consume secret key 
?>

in logintwitter.php
$request_token = $twitteroauth->getRequestToken('http://redirect url');


Download