Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mchmarny/ktweet
Knative Twitter Source
https://github.com/mchmarny/ktweet
Last synced: 5 days ago
JSON representation
Knative Twitter Source
- Host: GitHub
- URL: https://github.com/mchmarny/ktweet
- Owner: mchmarny
- License: apache-2.0
- Created: 2019-04-19T21:58:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T00:11:00.000Z (over 1 year ago)
- Last Synced: 2024-06-21T19:10:07.248Z (5 months ago)
- Language: Go
- Size: 4.11 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ktweet
Knative Twitter Source
Simple Twitter event source implementation for [Knative Eventing](http://github.com/knative/eventing) using `ContainerSource`.
## Setup
### Twitter API
To configure this event source you will need Twitter API access keys. [Good instructions on how to get them](https://iag.me/socialmedia/how-to-create-a-twitter-app-in-8-easy-steps/)
### Knative Secret
Create a secret with your Twitter access keys
```shell
kubectl create secret generic ktweet-secrets -n demo \
--from-literal=T_CONSUMER_KEY=${T_CONSUMER_KEY} \
--from-literal=T_CONSUMER_SECRET=${T_CONSUMER_SECRET} \
--from-literal=T_ACCESS_TOKEN=${T_ACCESS_TOKEN} \
--from-literal=T_ACCESS_SECRET=${T_ACCESS_SECRET}
```## Run
To launch `ktweet` event source just define the Twitter search query in the `config/source.yaml`.
For example, to have the `ktweet` produce events for matching the Twitter search for the term `Knative` your
`config/source.yaml` would look like this:```yaml
...
spec:
args:
- --query=Knative
...
```When done editing, just apply into your Knative cluster:
```shell
kubectl apply -f source.yaml -n demo
```### Logs
Once you know there are some tweets matching your search you might have to wait few seconds for `ktweet`
fetch it and you should see it in your target service```shell
kubectl logs -l eventing.knative.dev/source=twitter-source -n demo -c source
```