Showing posts with label Social. Show all posts
Showing posts with label Social. Show all posts

Instagram

http://instagram.pixelunion.net/
https://elfsight.com/blog/2016/05/how-to-get-instagram-access-token/

http://stackoverflow.com/questions/37593025/instagram-api-get-the-userid
https://api.instagram.com/v1/users/self/?access_token=2291348455.c37b51e.d347a9c5ea214e11b6f952780008c0a3


$userid = "2291348455";
$accessToken = "2291348455.c37b51e.d347a9c5ea214e11b6f952780008c0a3";

$json = file_get_contents("https://api.instagram.com/v1/users/2291348455/media/recent?access_token=2291348455.c37b51e.d347a9c5ea214e11b6f952780008c0a3");
$data = json_decode($json);
echo '<pre>';
print_r($data);
echo '</pre>';


$api = file_get_contents("https://api.instagram.com/v1/tags/YOURTAG/media/recent?access_token=YOURACCESSTOKEN");
$json = json_decode($api,true);
foreach($json['data'] as $data){
  if($data['user']['username']=="YOURSPECIFICUSERNAME"){
     //action
  }
}

Social Shares

<div class="share-links product-share icon-share"><i class="fa fa-share-alt"></i>
    <div class="share-icons-list" style="display: none">
        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo get_the_permalink(); ?>" target="_blank" class="js--popup"><i class="fa fa-facebook"></i></a>
        <a href="https://plus.google.com/share?url=<?php echo get_the_permalink(); ?>" target="_blank" class="js--popup"><i class="fa fa-google-plus"></i></a>
        <a href="http://twitter.com/home?status=<?php echo get_the_permalink(); ?>" target="_blank" class="js--popup"><i class="fa fa-twitter"></i></a>
    </div>
</div>

custom facebook share
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo home_url('/games') ?>&title=Games by The Mascoteers&description=Download the games free on your iOS or Android Devices!&picture=<?php echo get_option('games_share_image') ?>"target="_blank" class="js--popup share-btn">>Share This Page</a>


$(document).on('click','.share-links',function(){
    $(this).find('.share-icons-list').toggle('slow');
});
 
/* social popup window */
/* http://andy-carter.com/site/js/ui.min.js */
function click(n,o,t){for(var i=document.getElementsByTagName(n),e=new RegExp("\\b"+o+"\\b","g"),p=0;p<i.length;p++)i[p].className.match(e)&&t.apply(i[p])}function popupWindow(){this.onclick=function(){var n=this.getAttribute("href");return window.open(n,"popup","height=350,width=400,toolbar=no,location=no,status=no,menubar=no"),!1}}window.onload=function(){click("a","js--popup",popupWindow)};
 

Custom Share


<div class="post-share-wrapper">
    <script type="text/javascript">var switchTo5x=true;</script>
    <script type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>
    <script type="text/javascript">stLight.options({publisher: "ur-e5a5f499-31f1-433a-1588-1d24d71d5836", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
    <span class='st_sharethis_hcount' displayText='ShareThis'></span>
    <span class='st_facebook_hcount' displayText='Facebook'></span>
    <span class='st_twitter_hcount' displayText='Tweet'></span>
    <span class='st_linkedin_hcount' displayText='LinkedIn'></span>
    <span class='st_email_hcount' displayText='Email'></span>
   <span class='st_plusone_hcount' displayText='Google +1'></span>
</div>

Share popup

magento: http://inchoo.net/ecommerce/simple-social-sharing-buttons-in-magento/

Header section
<?php $product = Mage::registry('current_product');
if ($product): ?>
<meta property="og:title" content="<?php echo $product->getName(); ?>" />
<meta property="og:type" content="product" />
<meta property="og:url" content="<?php echo $this->helper('catalog/product')->getProductUrl($product); ?>" />
<meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'image')->resize(300, 300); ?>" />
<meta property="og:description" content="<?php echo strip_tags($product->getShortDescription()); ?>" />
<meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName() ?>" />
<?php endif; ?>

Body section
// Google Plus
<a href="javascript:popWin('https://plus.google.com/share?url=<?php echo urlencode($productUrl); ?>', 'google', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="<?php echo $this->__('Share on Google Plus') ?>">Google Plus</a>
// Facebook
<a href="javascript:popWin('https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($productUrl); ?>&t=<?php echo urlencode($productName); ?>', 'facebook', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="<?php echo $this->__('Share on Facebook') ?>">Facebook</a>
// Twitter
<a href="javascript:popWin('http://twitter.com/home/?status=<?php echo urlencode($productName . ' (' . $productUrl . ')'); ?>', 'twitter', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="<?php echo $this->__('Tweet') ?>">Twitter</a>
// Pinterest
<a href="javascript:popWin('https://pinterest.com/pin/create/button/?url=<?php echo urlencode($productUrl); ?>&media=<?php echo urlencode($productImage); ?>&description=<?php echo urlencode($productName); ?>', 'pinterest', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="<?php echo $this->__('Pin it') ?>">Pinterest</a>

 

facebook active access token problem

An active access token must be used to query information about the current user

Solution:
changing the line:

$me = $facebook->api('/me');
to
$me = $facebook->api('/'.$uid); 

Fb share or facebook share

<script src="//code.jquery.com/jquery-1.8.1.min.js"></script>
<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript" charset="utf-8"></script>
<a href="javascript:void(0);" class="fb-share-link" onclick="fb_share_prompt()">share</a>