Simple breaking news microservice written in Go
Quick Start
Grab the latest release for your platform
or
docker pull danesparza/twitter-breaking-news:latest
See the dockerfile for the environment variables you'll want to use to pass information to the service
Starting the service
To start the service, just run twitter-breaking-news
.
If you need help, just run twitter-breaking-news --help
.
There are a few command line parameters available:
Parameter |
Description |
port |
The port the service listens on. |
allowedOrigins |
comma seperated list of CORS origins to allow. In order to access the service directly from a javascript application, you'll need to specify the origin you'll be running the javascript site on. For example: http://www.myjavascriptapplication.com |
consumerKey |
The consumer key (API key). Get this from your Twitter app dashboard. |
consumerSecret |
The consumer secret (API secret). Get this from your Twitter app dashboard. |
authToken |
The auth token (Access Token). Get this from your Twitter app dashboard. |
authSecret |
The auth secret (Access Token Secret). Get this from your Twitter app dashboard. |
Testing the service
Once the service is up and running, you can connect to it using
http://yourhostname:3000/news/screenname
where screenname
is the twitter screen name you're using to get breaking news.
Example: http://yourdomain.com:3000/news/cnnbrk
To test your service quickly, you can use the Postman Google Chrome Extension to call the service and see the JSON return format.
News information will be returned as a JSON payload.
Building from source
To build, make sure you have the latest version of Go installed. If you've never used Go before, it's a quick install and there are installers for multiple platforms, including Windows, Linux and OSX.
go get github.com/danesparza/twitter-breaking-news
go build