Coder Social home page Coder Social logo

tweet-stream's Introduction

tweet-stream

全世界のツイートをリアルタイムに保存してごにょごにょするスクリプト

Feature

  • 初期設定では日本でつぶやかれた位置情報つきツイートのStreamを取得し,保存します
  • 含まれる文字列で検索するには,app.coffee 内の # 'track': tracks のコメントアウトを外してください

Quick start

First of all, DON’T PANIC. It will take 5 minutes to get the gist of what this script is all about.

Installation

  • You can install its dependencies with npm: npm install.
  • Get Your Twitter API Tokens and setup your API Keys to 'config/env.json'.
  • Then run script! You can read all of the tweets from the all over the world via Streaming API and save it to mongoDB.

Setup API keys

Please edit config/env.json

The keys listed below can be obtained from dev.twitter.com after setting up a new App.

{
  "mongo":                "mongodb://localhost/twitter",
  "consumer_key":         " Twitter ",
  "consumer_secret":      " API ",
  "access_token_key":     " Keys ",
  "access_token_secret":  " go here! "
}

Usage

Hello world.

# If you want to test script(Save tweets only when terminal launched).

$ coffee ./app.coffee

  --- Connect successful ---
  @high4_01_17 終末ヒロイン
  @HandsNet \おハンズございます/ 今日も1日よろしくお願いします。
  @kuji らむれ狩られるそうです
  @iris_sfc 紅茶のみたい珈琲胃にくる(´つヮ⊂)
  @sussaa_sfc 地下のファミマでぼったくられそうになった、パンとお茶で400円て、、
  @tako0846 原稿を書く時間が確実に減ってるやばい
  @gizmodejapan 【最新記事】 Androidのアクティブユーザー数、月10億人を突破 http://t.co/HhulkQJeDv
  ... (streaming)  

# Run as a production daemon.

$ pm2 start processes/production.json

  { online: true, success: true, pid: 37877, pm2_version: '0.9.1' }
  Process launched
  ┌──────────────┬────┬─────────┬───────┬────────┬───────────┬────────┬─────────────┬───────────┐
  │ App name     │ id │ mode    │ PID   │ status │ restarted │ uptime │      memory │  watching │
  ├──────────────┼────┼─────────┼───────┼────────┼───────────┼────────┼─────────────┼───────────┤
  │ tweet-stream │ 0  │ cluster │ 37878 │ online │         0 │ 0s     │ 26.570 MB   │ activated │
  └──────────────┴────┴─────────┴───────┴────────┴───────────┴────────┴─────────────┴───────────┘

# Then you can see the daemon status.

$ pm2 status

$ pm2 logs

tweet-stream's People

Contributors

takahiro47 avatar

Watchers

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