{"id":18045365,"url":"https://github.com/lance/twitter-translate-orchestration","last_synced_at":"2025-04-10T01:33:11.433Z","repository":{"id":66679348,"uuid":"538634308","full_name":"lance/twitter-translate-orchestration","owner":"lance","description":"5 minute lightning talk on building a Twitter translation bot with Knative Functions","archived":false,"fork":false,"pushed_at":"2022-10-10T19:59:38.000Z","size":166,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T03:11:26.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-19T18:06:22.000Z","updated_at":"2023-02-22T03:01:10.000Z","dependencies_parsed_at":"2023-04-13T11:03:47.576Z","dependency_job_id":null,"html_url":"https://github.com/lance/twitter-translate-orchestration","commit_stats":null,"previous_names":["lance/kubecon-na-2022"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lance%2Ftwitter-translate-orchestration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lance%2Ftwitter-translate-orchestration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lance%2Ftwitter-translate-orchestration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lance%2Ftwitter-translate-orchestration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lance","download_url":"https://codeload.github.com/lance/twitter-translate-orchestration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140320,"owners_count":21054279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T18:12:58.613Z","updated_at":"2025-04-10T01:33:11.403Z","avatar_url":"https://github.com/lance.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KubeCon NA 2022 - Build a Twitter Translate Bot in 5 Minutes\n\nThis demo converts tweets into English using Camel-K and Knative.\n\nIt uses a Camel-K Kamelet to periodically search Twitter for [some value].\nThe Kamelet converts each tweet into a CloudEvent, sending it to the default Knative\nBroker. A `translate` function receives these events via a `Trigger` between the\n`Broker` and the function which filters for these types of events.\n\nThe `translate` function inspects the tweet language and if it's English, it simply\nreturns the tweet text as the `data` for a translation event. If it's not English,\nthe Google Translation API is used to convert the tweet text to English, and the\nresult is returned as the `data` in the translation event.\n\nA `viewer` function is deployed to listen for translation events and display them in\nthe logs.\n\n![System diagram](diagram.png \"system diagram\")\n\n## Prerequisites\n* A cluster with Knative installed\n* CamelK https://camel.apache.org/camel-k/1.9.x/installation/installation.html installed\n* Google Translation API key in `translate/service-account-file.json`\n* Update the Twitter API credentials in [./resources/twitter-search-source-binding.yaml](resources/twitter-search-source-binding.yaml)\n\n\n## Steps\n* Deploy the `translate` and `viewer` functions\n```\nfunc deploy -p viewer\nfunc deploy -p translate\n```\n\n* Install a default Knative Broker\n```\nkn broker create default\n```\n\n* Create the Tweet-\u003eTranslate trigger\n```\nkn trigger create twitter-trigger -s translate --filter type=twitter.search.source\n```\n\n* Create the Translation-\u003eViewer trigger\n```\nkn trigger create translate-trigger -s viewer --filter type=knative.function.translation\n```\n\n* Install the Kamelet\n```\nkubectl apply -f resources/twitter-search-source-binding-v1.yaml\n```\n\n* Check the logs\n```\nk logs -l app=viewer --tail 10 -f\n```\n\n* Cleanup\n```\n./resources/teardown.sh\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flance%2Ftwitter-translate-orchestration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flance%2Ftwitter-translate-orchestration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flance%2Ftwitter-translate-orchestration/lists"}