Giter Site home page Giter Site logo

softpunch / node-twitter-wall Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tmwagency/node-twitter-wall

0.0 2.0 0.0 416 KB

A demo that builds on the initial basic setup to create a Twitter wall that monitors a set of tags.

ApacheConf 7.01% JavaScript 59.14% HTML 0.94% CSS 32.91%

node-twitter-wall's Introduction

Node Twitter Wall

View the demo >

This builds on the initial demo - the Node Basic Structure app.

This demo shows how to hook into the Twitter streaming API to make a Twitter wall – the same as you might see at a conference or event.

Building on the basic app's structure, it uses Desmond Morris' node-twitter library to connect to Twitter.

Note, that you will need to add your own Twitter API keys into the config in order for the application to work when run. Details of how to create and add these are shown below.

Creating your API Keys

To do this go to the Twitter developer site, Sign in, and from the menu in the top right corner click on the 'My applications' option.

Image to show the My applications option on the Twitter Devs site

Then click on create a new application in the top right of the screen, and fill out the 'Create an application' form. Once this is done, scroll to the bottom of the page to 'Your access token' and click on the 'Create my access token' button.

Image to show how to create Your Access tokens from the Twitter Dev site

The access token takes a few moments to be created, so give it a minute or so, refresh the page and you should see that Twitter has assigned your app an Access token.

There are then 4 values you need to make a note of on this page and add into the demo config.

  • Consumer key
  • Consumer secret
  • Access token
  • Access token secret

###Adding keys to a private config file (for local and development)

When working locally, it‘s a pain to have to declare environment variables each time you run your node application. Instead, you can store them in a private config file, and access them that way.

Note that you should only do this in development – when running on a production server, it‘s a better idea to declare your environment variables through the command line (see this article).

You can then add these to the application in a couple of ways.

An example private config file is located at config/_privconfg.js. Remove the underscore from the beginning of the file name and then open the file in your text editor of choice.

Once opened, look for the following:

local : {
	consumer_key: 'INSERT_CONSUMER_KEY_HERE',
	consumer_secret: 'INSERT_CONSUMER_SECRET_HERE',
	access_token_key: 'INSERT_ACCESS_TOKEN_KEY_HERE',
	access_token_secret: 'INSERT_ACCESS_TOKEN_SECRET_HERE'
}

Replace the variables in CAPS with the values from your own created app.

Save the file and then run the node application in the usual way, by running node index.js on the command line.

node-twitter-wall's People

Contributors

ashleynolan avatar

Watchers

James Cloos avatar Ryan 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.