Git Product home page Git Product logo

node-twitter-demo's Introduction

node-twitter-demo

Tutorial & Screencast: How to Tweet from NodeJS

A demo that shows Authn, Authz, Tweeting, and Direct Messages with twitter.

Upfront: If you're looking into any of the following libraries you're just wasting your time. They're mostly outdated and or unnecessary.

  • node-twitter-api
  • twitter-api
  • node-twitter
  • twitter

Instead you'll want to look at node-oauth and how it's used in this example.

Not to say that those other libraries aren't valuable, but just get it working with OAuth first and then go back and figure out which one you want to try to fork and bring up to date (or add features to).

Install this Demo

git clone [email protected]:coolaj86/node-twitter-demo.git
pushd node-twitter-demo
npm install

Sign up with twitter

You'll need to edit your /etc/hosts file so that local.example.com 127.0.0.1 exists (you can't use localhost for a twitter app's domain).

Sign up for a twitter developer account and then go to https://dev.twitter.com/apps and create an app.

Under the Settings Tab make sure that you have permissions for

  • Read, Write and Access direct messages
  • Allow this application to be used to Sign in with Twitter

Use

Change config.json to use your app's Consumer Key & Secret (which is on the Details tab).

Now run the app

node app

Visit http://local.example.com:3000 and play around.

Note that you'll have to authorize before you can use the Direct Message feature, no matter how many times you authenticate.

You can use the tweet functionality, however, just by authenticating.

Marvel

All of the magic happens in app.js and a tiny bit in views/index.jade. I don't think you need to look at anything else.

node-twitter-demo's People

Watchers

Jared Bruce avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.