Commit 8eabbd7dbd9b2dded7b63498494211fb0240a8dc

Authored by James McMinn
Exists in master

Fixed stray chars in the readme

Showing 2 changed files Side-by-side Diff

1 1 # Twitter Stream Reader
2 2 Opens a file or connects to the Twitter streaming API, and converts it to a
3   -standard JSON format, similar to the standard Twitter API JSON format.
  3 +standard JSON format, very similar to the standard Twitter API JSON format.
  4 +This can be used for development or in a production environment, and allows
  5 +the case code to be used for both experimental and live testing.
4 6  
5 7 ## Requirements
6 8 This requires the following packages:
7   - - github.com/jamesmcminn/twitter
8 9 \ No newline at end of file
  10 + - mirgit.dcs.gla.ac.uk/JamesMcMinn/twitter
  11 +
  12 + Required packages can be installed using `go get packagepath`
  13 +
  14 +## Installing
  15 +Twitter Stream Reader can be installed using a number of methods.
  16 +
  17 +The easiest method is to simply run `main.go` using the `go run` command:
  18 + go run main.go
  19 +
  20 +To build the application binary, `go build` can be used:
  21 +
  22 + run `go build mirgit.dcs.gla.ac.uk/JamesMcMinn/twitter-stream-reader`
  23 +
  24 +This will generate the binary in your current directory.
  25 +
  26 +## Usage
  27 +The stream reader has 2 modes:
  28 + - **File Mode**: Opens and reads a file, simulating the Twitter gardenhose
  29 + for testing and development.
  30 + - **Live Mode**: Using a set of specified keys, connect to the Twitter
  31 + steaming API and read the gardenhose.
  32 +
  33 +### Parameters
  34 +
  35 + -ck= Consumer Key
  36 + -cs= Consumer Secret
  37 + -os= OAuthTokenSecret
  38 + -ot= OAuth Token
  39 +
  40 + -if= Input File to read from for File Mode
  41 +
  42 + -port= (Optional) Port to listen on which other applications can connect to. Optional. Default: 8053
  43 +
  44 +
  45 +### Live Mode Example
  46 +**Note** You will need to generate OAuth keys by visiting http://developer.twitter.com
  47 +
  48 + go run main.go -ck=consumerKey -cs=consumerSecret -ot=OAuthToken -os=OAuthTokenSecret
  49 +
  50 +### File Mode Example
  51 +The file should contain valid JSON, with one Tweet per line. The stream reader will read this file,
  52 +parse any JSON, and output it in the same format used the Streaming API. In this example, we also
  53 +use port 85632 rather than the default port or 8053.
  54 +
  55 + go run main.go -if=/home/james/tweets.json -port=85632
9 56 \ No newline at end of file
... ... @@ -4,9 +4,9 @@ import (
4 4 "bufio"
5 5 "flag"
6 6 "fmt"
7   - "github.com/jamesmcminn/twitter"
8 7 "io"
9 8 "log"
  9 + "mirgit.dcs.gla.ac.uk/JamesMcMinn/twitter"
10 10 "net"
11 11 "os"
12 12 "runtime"