Sha256: 9a90a5c2e4b5fd76029ef5d2da9ae8119edb5a780606446d888c0cbc9abc0f3c

Contents?: true

Size: 1.97 KB

Versions: 4

Compression:

Stored size: 1.97 KB

Contents

{% assign file = page.fileName %}
{% assign folder = page.folderName %}
{% assign lang = page.lang %}
{% assign shareData=site.data[folder][lang][file] %}
{%- if site.data.blog.share.platforms -%}
<div class="social-icons">
    {% assign url = page.url | relative_url | prepend: site.url %}
    {% for share in site.data.blog.share.platforms %}
    {% assign link = share.link | replace: 'URL', url %}
    {{page.title}}
     <a  id="{{share.type}}" href="{{ link }}" data-toggle="tooltip"
            onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;"
            data-placement="top" title="{{ share.type }}" aria-label="{{ share.type }}">
            <i class="fa-fw {{ share.icon }} mb-0 py-3"></i>
        </a>
   
    {% endfor %}
</ul>    
</ul>
</div>
{%- endif -%}
<script>
    const fetchShareCount=async()=>{
try {
    const faceBookShare=document.querySelector('#Facebook')
        const twitterShare=document.querySelector('#Twitter')
        const faceBookCount= await fetch(`https://graph.facebook.com/v10.0/?id=${window.location.href}&access_token=275277164346802|6255ba7980a711477b429c302cb009cd&fields=engagement`).then(res=>res.json())
        const twitterCount=await fetch(`https://counts.twitcount.com/counts.php?url=${window.location.href}`).then(res=>res.json())        
        if(faceBookCount.engagement.share_count>0){
        const FacebookInfo =document.createElement('span')
        FacebookInfo.setAttribute("class", "social-count")
        FacebookInfo.innerHTML=faceBookCount.engagement.share_count
        faceBookShare.appendChild(FacebookInfo)
        }
        if(twitterCount>0){
        const TwitterInfo =document.createElement('span')
        TwitterInfo.setAttribute("class", "social-count")
        TwitterInfo.innerHTML=twitterCount.count
        twitterShare.appendChild(TwitterInfo)
   }
} catch (error) {
}
    }
 
    window.addEventListener("load",()=>{
        fetchShareCount()

});
</script>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
appscms-tools-theme-1.3.5 _includes/share/socialshare.html
appscms-tools-theme-1.3.4 _includes/share/socialshare.html
appscms-tools-theme-1.3.3 _includes/share/socialshare.html
appscms-tools-theme-1.3.2 _includes/share/socialshare.html