npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aping-plugin-codebird

v0.7.8

Published

Twitter plugin for apiNG

Downloads

7

Readme

apiNG

apiNG-plugin-codebird is a Twitter REST API plugin for apiNG.

npm version Bower version

Information

Documentation

  1. INSTALLATION
    1. Get file
    2. Include file
    3. Add dependency
    4. Add plugin
  2. BEARER TOKEN
    1. Generate your bearer_token
    2. Insert your bearer_token into aping-config.js
  3. USAGE
    1. Models
    2. Requests
    3. Rate limit

1. INSTALLATION

I. Get file

Install via either bower, npm, CDN (jsDelivr) or downloaded files:

II. Include file

Include aping-plugin-codebird.min.js in your apiNG application

<!-- when using bower -->
<script src="bower_components/apiNG-plugin-codebird/dist/aping-plugin-codebird.min.js"></script>

<!-- when using npm -->
<script src="node_modules/aping-plugin-codebird/dist/aping-plugin-codebird.min.js"></script>

<!-- when using cdn file -->
<script src="//cdn.jsdelivr.net/aping.plugin-codebird/latest/aping-plugin-codebird.min.js"></script>

<!-- when using downloaded files -->
<script src="aping-plugin-codebird.min.js"></script>

III. Add dependency

Add the module jtt_aping_codebird as a dependency to your app module:

angular.module('app', ['jtt_aping', 'jtt_aping_codebird']);

IV. Add the plugin

Add the plugin's directive aping-codebird="[]" to your apiNG directive and configure your requests

<aping
    template-url="templates/social.html"
    model="social"
    items="20"
    aping-codebird="[{'search':'#music'}]">
</aping>

2. BEARER TOKEN

I. Generate your bearer_token

  1. Login on dev.twitter.com
  2. Navigate to apps.twitter.com
    • Create an new app
    • Navigate to https://apps.twitter.com/app/<YOUR_APP_ID>/permissions
      • Change Access to Read only and save
    • Navigate to https://apps.twitter.com/app/<YOUR_APP_ID>
  3. Get your bearer_token
    • Follow this official introductions: https://dev.twitter.com/oauth/reference/post/oauth2/token
    • OR just use this simple generator: https://gearside.com/nebula/documentation/utilities/twitter-bearer-token-generator/

II. Insert your bearer_token into aping-config.js

Create and open js/apiNG/aping-config.js in your application folder. It should be look like this snippet:

angular.module('jtt_aping').config(['$provide', function ($provide) {
    $provide.value("apingDefaultSettings", {
        apingApiKeys : {
            twitter: [
                {'bearer_token':'<YOUR_TWITTER_BEARER_TOKEN>'}
            ],
            //...
        }
    });
}]);

:warning: Replace <YOUR_TWITTER_BEARER_TOKEN> with your twitter bearer_token

3. USAGE

I. Models

Supported apiNG models

| model | content | support | max itemsper request | (native) default itemsper request | |----------|---------|---------|--------|---------| | social | recent tweets, videos, images | full | 100 | 15 | | image | recent images | partly | 100 | 15 |

support:

  • full: the source platform provides a full list with usable results
  • partly: the source platfrom provides just partly usable results

II. Requests

Every apiNG plugin expects an array of requests as html attribute.

Requests by User

| parameter | sample | default | description | optional | |----------|---------|---------|---------|---------| | user | jquery | | The twitter screen name of the user for whom to return results for | no | | items | 20 | 15 | Items per request (0-100) | yes | | showAvatar | true | false | Use true for show users avatar as image if post has no own image | yes | | exclude_replies | true | false | This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the items parameter will mean you will receive up-to count tweets — this is because the items parameter retrieves that many tweets before filtering out retweets and replies. | yes | | include_rts | false | true | When set to false, the timeline will strip any native retweets (though they will still count toward both the maximal length of the timeline and the slice selected by the count parameter). | yes |

Sample requests:

  • [{'user':'johnnyzeitlos'}, {'user':'jowe'}, {'user':'angularui'}]
  • [{'user':'AngularAir', 'items':10, 'showAvatar':'true', 'exclude_replies':true}]

Requests by Search

| parameter | sample | default | description | optional | |----------|---------|---------|---------|---------| | search | jquery | | Searchterm. A UTF-8, URL-encoded search query of 500 characters maximum, including operators. Queries may additionally be limited by complexity. | no | | items | 20 | 15 | Items per request (0-100) | yes | | showAvatar | true | false | Use true for show users avatar as image if post has no own image | yes | | result_type | recent | mixed | mixed include both popular and real time results in the responserecent return only the most recent results in the responsepopular return only the most popular results in the response | yes | | lat | -13.163333 | | Returns tweets by users located within a given radius of the given latitude/longitude | yes | | lng | -72.545556 | | Returns tweets by users located within a given radius of the given latitude/longitude | yes | | distance | 5 | 1 | Returns tweets by users located within a given radius in kilometers of the given latitude/longitude | yes | | language | de | | Restricts tweets to the given language, given by an ISO 639-1 code | yes |

Sample requests:

  • [{'search':'#eagles', 'result_type':'recent'}, {'search':'Thomas Müller', 'result_type':'popular'}]
  • [{'search':'machu picchu', 'lat':'-13.163333', 'lng':'-72.545556', 'distance':5}]

III. Rate limit

Visit the official Twitter REST API rate limit documentations

Licence

MIT