- pip
-> indicoio
-> flask
- -> flask_restfut
+ -> flask_restful
+
### commands
- `python3.7 sentiment_analysis.py`
+- positive sentiment test example: `curl -vs -H 'content-type: application/json' -X POST http://localhost:8081 -d '[{"text":"happy birthday, i love you"}]'`
+- negative sentiment test example: `curl -vs -H 'content-type: application/json' -X POST http://localhost:8081 -d '[{"text":"i hate you, please die"}]'`
- .net core 2.2
- download [libwkhtml library](https://github.com/rdvojmoc/DinkToPdf/tree/master/v0.12.4) depending on your operating system and put it into `service-reporting` root folder
### commands
-- `dotnet run`
\ No newline at end of file
+- `dotnet run`
+
+## Tests
+- successfull pdf as application/json: `curl -X POST http://localhost:8083/generatePDF -H 'Content-Type: application/json' -d '[ { "name": "A bad term", "sentiment": 0.1 }, { "name": "Another bad term", "sentiment": 0.3 }, { "name": "A neutral term", "sentiment": 0.5 }, { "name": "A good term", "sentiment": 0.65 }, { "name": "Another good term", "sentiment": 0.9 } ] ' -vs > test1.pdf`
+- successfull pdf as application/base64: `curl -X POST http://localhost:8083/generatePDF -H 'Accept: application/base64' -H 'Content-Type: application/json' -d '[ { "name": "A bad term", "sentiment": 0.1 }, { "name": "Another bad term", "sentiment": 0.3 }, { "name": "A neutral term", "sentiment": 0.5 }, { "name": "A good term", "sentiment": 0.65 }, { "name": "Another good term", "sentiment": 0.9 } ] ' -vs | base64 -d > test2.pdf`
+- invalid sentiment value: `curl -X POST http://localhost:8083/generatePDF -H 'Content-Type: application/json' -d '[ { "name": "Term with invalid sentiment value", "sentiment": 12 } ] ' -vs && echo`
+- invalid json structure: `curl -X POST http://localhost:8083/generatePDF -H 'Content-Type: application/json' -d '[ { "name1": "A term with invalid json format", "sentiment": 0.5 } ] ' -vs && echo`
\ No newline at end of file
# Twitter Service
+
## API
-You can use the search under: [http://localhost:8084/search/tweets.json?q=Google](http://localhost:8080/search/tweets.json?q=Google)
+You can use the search under [http://localhost:8084/search/tweets.json?q=Google](http://localhost:8080/search/tweets.json?q=Google)
where `q` is your search string.
It mainly mirrors the search API from Twitter. My implementation contains some basic fields with the same names as in
the official API. If you need more, please let me know.
+### Example
+
+`curl -vs http://localhost:8084/search/tweets.json?q=Google `
+
+Pipe it into e.g. `jq` for a more readable output.
+
+
+
## API Keys
Unfortunately you have to provide your own API Keys, as sharing them is forbidden. In the worst case there would be five