Commit b554e74567c7a3ba2d547aa04fe81c33c8fad632

Authored by James McMinn
1 parent 8eabbd7dbd
Exists in master

Fixed a bad merge...

Showing 1 changed file with 0 additions and 8 deletions Inline Diff

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