# twitter-starling

> Twitter REST & Streaming client for use with node.js

Latest version **0.0.2** (published 2012-10-02) · 0 weekly downloads

## Install

```sh
npm install twitter-starling
pnpm add twitter-starling
yarn add twitter-starling
bun add twitter-starling
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2012-10-02 |
| First published | 2012-10-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.6.18 |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Sean Nicholls |
| Maintainers | seannicholls |
| Keywords | twitter, rest, streaming, api, oauth |

## Links

- npm: https://www.npmjs.com/package/twitter-starling
- Repository: https://github.com/seannicholls/twitter-starling
- npm.io page: https://npm.io/package/twitter-starling

## Dependencies (3)

- [oauth](https://npm.io/package/oauth.md) >=0.8.4
- [request](https://npm.io/package/request.md) >=2.11.4
- [querystring](https://npm.io/package/querystring.md) >=0.1

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@oxyhq/services](https://npm.io/package/@oxyhq/services.md) — 2.3K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2012-10-02
- 0.0.1 — 2012-10-02

## README

#twitter-starling

Twitter REST & Streaming API client for Node.js

Still very much a work-in-progress.


## Getting Started

Install twitter-starling:
```bash
npm install twitter-starling
```

Include the twitter library:
```javascript
var Twitter = require('twitter-starling');
```

[ **optional** ] Create an authentication credential :
```javascript
var credential = new Twitter.LoginCredential(   'CONSUMER_KEY',
                                                'CONSUMER_SECRET',
                                                'ACCESS_TOKEN',
                                                'ACCESS_TOKEN_SECRET'   );
```

Create the Twitter client:
```javascript
var authorisedTwitter = new Twitter(credential);
```

## Examples

Query the Twitter REST API:

```javascript
// get the public timeline
authorisedTwitter.timeline.public( {}, function(result, parent) {
    
    if(result.isSuccess) {
        var tweets = result.message();
        for(var i=0; i<tweets.length; i++) {
            console.log(util.summariseTwitter(tweets[i], '(public_timeline) '));
        }
    } else {
        console.log("Error: " + result.message); 
    }
	
    console.log('---------------------------');
    
});
```

Query the Twitter Streaming API:

```javascript
// sample the public timeline
authorisedTwitter.stream.statuses.sample({}, function(result) {
    
    if(result.isSuccess) {
    
    try {
        var tweet = JSON.parse(result.data);
        
            if(typeof tweets[j].user === 'undefined') {
                console.log('[' + user.screen_name + '] ' + postfix);
            } else if(typeof tweets[j].status === 'undefined') {
                console.log('[' + tweet.user.screen_name + '] ' + tweet.text + postfix);
            }
        
        } catch (e) {
            // best to just ignore it, eh?
        }
        
    } else {
    
        console.log("Error: " + result.message);
    
    }

});
```
## More examples

From root source folder you can try out some examples in the ***test*** directory:

```bash
node test
```

this will execute some basic REST and Streaming functionality and is a good starting point if the above examples aren't detailed enough.


## Going Forward

### Twitter-Starling is still in active development. 

Most of the functionality is there, but some testing is lacking (there are no unit tests, oh dear!) so you can continue to use it but it would not be advisable to do so on production systems. not yet at least.

#### Where do I get the source code?
Check the GitHub repo here: https://github.com/seannicholls/twitter-starling

#### I want to contribute 
Contact me (Sean Nicholls) on [GitHub](https://github.com/seannicholls) 

The biggest need right now is full documentation of the library. So if you're documentally inclined, get in touch!

#### License
MIT License - fork, modify and use however you want.

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