Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mchmarny/twitter-search-dapr-component-example
Twitter search dapr input component example
https://github.com/mchmarny/twitter-search-dapr-component-example
dapr dapr-component example
Last synced: 5 days ago
JSON representation
Twitter search dapr input component example
- Host: GitHub
- URL: https://github.com/mchmarny/twitter-search-dapr-component-example
- Owner: mchmarny
- License: apache-2.0
- Created: 2020-04-29T14:37:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-05T02:24:15.000Z (over 1 year ago)
- Last Synced: 2024-06-21T21:06:06.669Z (5 months ago)
- Topics: dapr, dapr-component, example
- Language: Go
- Size: 6.99 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twitter-search-dapr-component-example
Example of how to use Twitter search input component in [godapr](https://github.com/mchmarny/godapr).
## Prerequisites
### dapr
To run this demo locally, you will have to have install [dapr](https://github.com). The instructions for how to do that can be found [here](https://github.com/dapr/docs/blob/master/getting-started/environment-setup.md).
To configure the dapr input component to query Twitter API you will also need the consumer key and secret. You can get these by registering a Twitter application [here](https://developer.twitter.com/en/apps/create).
## Setup
Assuming you have all the prerequisites mentioned above you can demo this dapr pipeline in following steps. First, start by cloning this repo:
```shell
git clone https://github.com/mchmarny/twitter-search-dapr-component-example.git
```and then navigate into the `twitter-search-dapr-component-example` directory:
```shell
cd twitter-search-dapr-component-example
```### Component
Insert your Twitter API secrets into the [components/twitter.yaml](components/twitter.yaml) file.
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: tweets
spec:
type: bindings.twitter
metadata:
- name: consumerKey
value: ""
- name: consumerSecret
value: ""
- name: accessToken
value: ""
- name: accessSecret
value: ""
- name: query
value: "serverless"
```The `query` is the twitter search query for which you want to receive tweets.
### Run
Once the Twitter API consumer and access details are set, you are ready to run:
```shell
dapr run go run handler.go main.go \
--app-id "consumer" \
--app-port 8081 \
--protocol http \
--port 3500
```Assuming everything went OK, you should see something like this:
```shell
ℹ️ Updating metadata for app command: handler.go main.go
✅ You're up and running! Both Dapr and your app logs will appear here.
```Hope you found this demo helpful.
## Disclaimer
This is my personal project and it does not represent my employer. I take no responsibility for issues caused by this code. I do my best to ensure that everything works, but if something goes wrong, my apologies is all you will get.
## License
This software is released under the [Apache v2 License](./LICENSE)