twitter-streaming

command module
v0.0.0-...-e3952f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 11 Imported by: 0

README

A Simple Twitter Streaming Application written in #Golang

Build Status Go Report Card FOSSA Status

This project is deprecated. Because Twitter closes free api. It was a pet project.

First Step

Install Required Dependencies

To install required dependencies, just run the make initialize command. It fetches all golang dependencies and nodejs packages. Don't forget to add make, go, npm must be in PATH enviropment variables.

Running

After installing required dependencies, you can build and run the program. Then run these commands one by one:

  • To build backend module run make build
  • To build and copy them into the public folder, execute make build-copy-frontend-files

Now you can run the program with ./twitterStreaming command. Execute ./twitterStreaming -h to get help about program.

twitterStreaming -v => Display version
twitterStreaming -h => Display usage
twitterStreaming -config=config.json => Set the config file
               config.json
               {
                   "Port":3000,
                   "Twitter" : {
                        	"ConsumerKey":"xxx"
                        	"ConsumerKeyConsumerSecret":"xxx"
                        	"ConsumerKeyAccessTokenKey":"xxx"
                        	"ConsumerKeyAccessTokenSecret":"xxx"
                    }
               }
Run at Docker

You can run it with this command: docker run -it --dns 8.8.8.8 -p 3000:3000 rayyildiz/twitter-streaming

Configuration

Application looks for a config.json in current folder (defualt). However you can change the config file by ./twitterStreaming -config=abc.json

{
    "Port":3000,
    "Twitter" : {
			"ConsumerKey":"xxx"
	      		"ConsumerKeyConsumerSecret":"xxx"
	      		"ConsumerKeyAccessTokenKey":"xxx"
	      		"ConsumerKeyAccessTokenSecret":"xxx"
	      }
}
Twitter Configuration

You need to register an application at https://dev.twitter.com. Just go to https://apps.twitter.com/app/new and create an application. After that you need Consumer Key (API Key) , Consumer Secret (API Secret) , Access Token , Access Token Secret . Also don't forget the change persmision your account as Read only

Change these values with yours in config.json. There is a sample config information by default.

Now just execute make run and hit the http://localhost:3000 (if port is 3000 in config.json)

Run Application at Docker

If you have problem and install the docker, you can execute make docker build and make docker-run . This commans build and run the application at docker.

You can find the docker image at https://hub.docker.com/r/rayyildiz/twitter-streaming/

License

FOSSA Status

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL