# get-popular-tweets

> This module grabs "popular" tweets at random by jumping from the `trends/place` Twitter API endpoint to `search/tweets`.

Latest version **1.0.1** (published 2015-09-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-popular-tweets
pnpm add get-popular-tweets
yarn add get-popular-tweets
bun add get-popular-tweets
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-09-27 |
| First published | 2015-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jim Kang |
| Maintainers | jimkang |

## Links

- npm: https://www.npmjs.com/package/get-popular-tweets
- Repository: https://github.com/jimkang/get-popular-tweets
- Issues: https://github.com/jimkang/get-popular-tweets/issues
- npm.io page: https://npm.io/package/get-popular-tweets

## Dependencies (4)

- [twit](https://npm.io/package/twit.md) ^2.1.0
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [probable](https://npm.io/package/probable.md) ^1.7.0
- [call-next-tick](https://npm.io/package/call-next-tick.md) ^1.1.2

## Recent versions

- 1.0.1 (latest) — 2015-09-27
- 1.0.0 — 2015-09-27

## README

get-popular-tweets
==================

This module grabs "popular" tweets at random by jumping from the `trends/available` Twitter API endpoint to `trends/place` to `search/tweets`.

Installation
------------

    npm install get-popular-tweets

Usage
-----

    var getPopularTweets = require('get-popular-tweets');
    var opts = {
      twitterCreds: {
        consumer_key: 'asdfkljqwerjasdfalpsdfjas',
        consumer_secret: 'asdfasdjfbkjqwhbefubvskjhfbgasdjfhgaksjdhfgaksdxvc',
        access_token: '9999999999-zxcvkljhpoiuqwerkjhmnb,mnzxcvasdklfhwer',
        access_token_secret: 'opoijkljsadfbzxcnvkmokwertlknfgmoskdfgossodrh'
      },
      woeid: 23424977 // US
    };
    getPopularTweets(twitterCreds, logTweets)

    function logTweets(error, tweets) {
      if (error) {
        console.log(error);
      }
      else {
        console.log(JSON.stringify(tweets, null, '  '));
      }
    }

(`woeid` is the Yahoo [Where on Earth ID](https://developer.yahoo.com/geo/geoplanet/guide/concepts.html). Defaults to 1, which is 'global'.)

Try it out from within the project by creating a `config.js` file in the project root that contains [Twitter API keys](https://gist.github.com/jimkang/34d16247b40097d8cace). Example:

    module.exports = {
      twitter: {
        consumer_key: 'asdfkljqwerjasdfalpsdfjas',
        consumer_secret: 'asdfasdjfbkjqwhbefubvskjhfbgasdjfhgaksjdhfgaksdxvc',
        access_token: '9999999999-zxcvkljhpoiuqwerkjhmnb,mnzxcvasdklfhwer',
        access_token_secret: 'opoijkljsadfbzxcnvkmokwertlknfgmoskdfgossodrh'
      }
    };

Then, run:

    node tools/run-get-popular-tweets.js

License
-------

The MIT License (MIT)

Copyright (c) 2015 Jim Kang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

---
_Source: https://npm.io/package/get-popular-tweets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
