count-shares

2019-10-11 admin

count-shares是什么

什么是count-shares,Returns JSON with a number of shares for a URL

count-shares使用教程帮助文档

Social widgets

Build Status

Likes, shares and things like that.

Table Of Contents

  • share
  • history api
  • count-shares (JSON with number of shares)

<a name=“user-content-share”></a>

share

Example: https://facebook.com/sharer/sharer.php?u=http://google.com

| Network | URL | Documentation | | Facebook | https://facebook.com/sharer/sharer.php?u={{LINK}} | share, like | | Twitter | http://twitter.com/share?url={{LINK}} | link | | Twitter | https://twitter.com/intent/tweet?url={{LINK}} | link | | Google Plus | https://plus.google.com/share?url={{LINK}} | link | | Linked In | http://www.linkedin.com/shareArticle?url={{LINK}} | link | | VK | http://vkontakte.ru/share.php?url={{LINK}} | link | | Odnoklassniki | https://connect.ok.ru/dk?st.cmd=extLike&uid=odklcnt0&ref={{LINK}} | | | Yandex | http://share.yandex.ru/go.xml?service=yaru&url={{LINK}}&title={{TITLE}}&body={{TEXT}} | | | Livejournal | http://www.livejournal.com/update.bml?subject={{TITLE}}&event={{TEXT}}&prop_taglist={{TAGS}}&href={{LINK}} | |

<a name=“user-content-historyapi”></a>

history api (reloading social widgets)

| Network | What to do | | Twitter |

  • Replace the old button with HTML code from Twitter documentation (see the link in the table above).

          Example:
          <pre><code>&lt;a href="https://twitter.com/share"
    
    

    class=“twitter-share-button” data-url="’ + window.location.href + '">Tweet</a>

  • Call twttr.widgets.load();

|

<a name=“user-content-count-shares”></a>

count-shares

Returns JSON with a number of shares for a page.

{
    "facebook": 5461703,
    "twitter": 11876867,
    "vk": 2462,
    "odnoklassniki": 547,
    "pinterest": 60,
    "linkedin": 18113
}

JavaScript (node.js)

npm install count-shares

See README here.

PHP

API

Example: ./count-shares/php/main.php?url=http://www.google.com&networks=facebook,twitter

url (required)

www.domain.com and domain.com are different websites for Twitter and Odnoklassniki. domain.com#anchor, domain.com?key=value and domain.com are different websites too for all social networks.

networks

Comma separated. facebook, twitter, linkedin, pinterest, vk or odnoklassniki.

Default: Facebook and Twitter.

Bitdeli Badge

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-77097.html

文章标题:count-shares

回到顶部