count-shares

Returns JSON with a number of shares for a URL

count-shares

Returns JSON with a number of shares for a URL.

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

Example

var countShares = require( 'count-shares' );

countShares.get( {
    url: 'http://google.com',
    accessTokens: {
        fb: 'foobar'
    }
}, function( err, result ) {  } );

Methods

get( conf, callback[, networks] )

conf: {Object} An object defining config needed to make requests to different APIs.

conf.url: {String} full URL. www.domain.comand domain.comare different websites for Twitter and Odnoklassniki.

conf.accessTokens.fb: {String} a valid facebook access token

Twitter's old endpoint http://urls.api.twitter.com/1/urls/count.json?url=stopped work on November 20th, 2015, and according to this postthere are no plans to replace it with anything in the short term.

callback( err, result ): {Function} callback that will get the results and errors (if any)

networks: (optional) {Array} or {String} available networks: facebook, linkedin, odnoklassniki, pinterest, vk (vkontakte). Need more? Contribute!

Repository

https://github.com/clexit/social-widgets


上一篇:packflow
下一篇:node-ga-plus

相关推荐

  • world-countries

    List of world countries in JSON, CSV, XML and Yaml World countries in JSON, CSV, XML and YAML. ...

    8 个月前
  • word-count

    Word count in respect of CJK characters. wordcount Word count in respect of CJK characters. Bui...

    1 年前
  • why does javascript getMonth count from 0 and getDate count from 1?

    SomeShinyObjectPrimeLens(https://stackoverflow.com/users/860857/someshinyobject)提出了一个问题:why does jav...

    2 年前
  • webpack LimitChunkCountPlugin

    LimitChunkCountPlugin...

    3 个月前
  • web3-eth-accounts

    Web3 module to generate Ethereum accounts and sign data and transactions. web3ethaccounts This is...

    1 年前
  • w3counter

    Get ten most popular screen resolutions, browsers and operating systems w3counter Build Status(htt...

    1 年前
  • vue2-countdown vue活动倒计时组件

    题目:基于vue2.x的活动倒计时组件 最近公司在写一个移动商城的项目,涉及到拼团的内容,于是就有了倒计时的需求。一时没有想法,就在github上找到了vue2countdown(https://g...

    2 年前
  • vtex-account

    Lib Boilerplate VtexAccount Helpers to manipulate Vtex account data. HomePage https://github....

    1 年前
  • township-accounts

    Node.js library for managing user accounts. townshipaccounts Node.js library for managing user ac...

    5 个月前
  • test-runner-counter

    Pass a test once a certain number of asynchronous events complete view on npm(https://img.shields.i...

    1 年前

官方社区

扫码加入 JavaScript 社区