-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* TwitterStream collection for covid-19 stream * WIP: covid19 eventsapi * Covid SQL query fix and docker version change * Handle null exception for tweet user object * Refactored code to restart closed partition connections * Changing fatal to panic for restarting partitions. Changed some log msgs * Increasing buffer size of request and error handling
- Loading branch information
Showing
22 changed files
with
4,623 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
all: jar | ||
|
||
TAG_CLIENT = 1.0.32 | ||
TAG_CLIENT = 1.0.33 | ||
PROJECT_NAME = eventsapi | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.idea | ||
main | ||
mainmac | ||
app.sh | ||
keywords.txt | ||
pkg | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM scratch | ||
ADD ca-certificates.crt /etc/ssl/certs/ | ||
ADD main / | ||
CMD ["/main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
all: build | ||
push: push | ||
.PHONY: push build | ||
|
||
TAG = 1.0.1 | ||
PROJECT_NAME = twitter-stream-covid19 | ||
|
||
build: main ca-certificates.crt | ||
docker build -t projectepic/$(PROJECT_NAME) . | ||
docker tag projectepic/$(PROJECT_NAME) projectepic/$(PROJECT_NAME):$(TAG) | ||
|
||
push: build | ||
docker push projectepic/$(PROJECT_NAME) | ||
docker push projectepic/$(PROJECT_NAME):$(TAG) | ||
|
||
main: src/TwitterStreamCovid19/TwitterStreamCovid19.go | ||
cd src/TwitterStreamCovid19/ && GOPATH="$$(pwd)/../../" dep ensure | ||
cd src/TwitterStreamCovid19/ && GOPATH="$$(pwd)/../../" CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ../../main TwitterStreamCovid19.go | ||
|
||
mainmac: src/TwitterStreamCovid19/TwitterStreamCovid19.go | ||
cd src/TwitterStreamCovid19/ && GOPATH="$$(pwd)/../../" dep ensure | ||
cd src/TwitterStreamCovid19/ && GOPATH="$$(pwd)/../../" CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -o ../../mainmac TwitterStreamCovid19.go | ||
|
||
runmac: mainmac | ||
./mainmac | ||
|
||
run: mainmac | ||
./main | ||
|
||
ca-certificates.crt: | ||
curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem | ||
mv cacert.pem ca-certificates.crt | ||
|
||
clean: | ||
docker rmi projectepic/$(PROJECT_NAME):$(TAG) || : | ||
docker rmi projectepic/$(PROJECT_NAME) || : | ||
rm ca-certificates.crt | ||
rm main | ||
rm mainmac | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Twitter streaming API Client | ||
|
||
Client that watches a specific file for userids and connects to the filter Streaming API. | ||
|
||
All tweets are forwarded to an specified kafka queue. | ||
|
||
|
||
## Run locally | ||
|
||
Required: GoLang, `dep` | ||
|
||
- `cd src/TwitterStreamCovid19/ && GOPATH="$(pwd)/../../" dep ensure` | ||
- `cp app.sh.template app.sh` | ||
- Modify Twitter credentials | ||
- `chmod +x app.sh` | ||
- `./app.sh` | ||
|
||
## Deploy to Docker | ||
|
||
- `make push` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
export TWITTER_CONSUMER_API_KEY="REPLACE" | ||
export TWITTER_CONSUMER_API_SECRET="REPLACE" | ||
|
||
GOPATH="$(pwd)" go run src/TwitterStreamCovid19/TwitterStreamCovid19.go | ||
|
Oops, something went wrong.