{"id":15725171,"url":"https://github.com/eggplants/get-twitter-shortened-url","last_synced_at":"2026-03-05T20:22:59.031Z","repository":{"id":57434050,"uuid":"335712890","full_name":"eggplants/get-twitter-shortened-url","owner":"eggplants","description":"Get shortened link(s) from Twitter URL Shortener (t.co)","archived":false,"fork":false,"pushed_at":"2021-12-20T04:02:24.000Z","size":26,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-22T15:29:22.502Z","etag":null,"topics":["shorten-urls","shortener","twitter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eggplants.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-03T18:08:31.000Z","updated_at":"2023-11-21T20:01:06.000Z","dependencies_parsed_at":"2022-08-27T22:31:25.738Z","dependency_job_id":null,"html_url":"https://github.com/eggplants/get-twitter-shortened-url","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eggplants/get-twitter-shortened-url","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggplants%2Fget-twitter-shortened-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggplants%2Fget-twitter-shortened-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggplants%2Fget-twitter-shortened-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggplants%2Fget-twitter-shortened-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggplants","download_url":"https://codeload.github.com/eggplants/get-twitter-shortened-url/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggplants%2Fget-twitter-shortened-url/sbom","scorecard":{"id":368822,"data":{"date":"2025-08-11","repo":{"name":"github.com/eggplants/get-twitter-shortened-url","commit":"0af23e2c2d5a124a75e3a32365af4430115ef47e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/eggplants/get-twitter-shortened-url/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/eggplants/get-twitter-shortened-url/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/eggplants/get-twitter-shortened-url/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/eggplants/get-twitter-shortened-url/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/eggplants/get-twitter-shortened-url/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/eggplants/get-twitter-shortened-url/test.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:40","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:41","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:42","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:33","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:34","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:35","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:36","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   7 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2012-17 / GHSA-pwx5-xg7g-wpc5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T12:30:24.320Z","repository_id":57434050,"created_at":"2025-08-18T12:30:24.320Z","updated_at":"2025-08-18T12:30:24.320Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005462,"owners_count":26083902,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["shorten-urls","shortener","twitter"],"created_at":"2024-10-03T22:19:57.090Z","updated_at":"2025-10-10T22:46:17.397Z","avatar_url":"https://github.com/eggplants.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-twitter-shortened-url (`t_co`)\n\n[![Release Package](https://github.com/eggplants/get-twitter-shortened-url/actions/workflows/release.yml/badge.svg)](https://github.com/eggplants/get-twitter-shortened-url/actions/workflows/release.yml) [![Test and Report CC](https://github.com/eggplants/get-twitter-shortened-url/actions/workflows/test.yml/badge.svg)](https://github.com/eggplants/get-twitter-shortened-url/actions/workflows/test.yml)\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/b48c32d3b82a3cdd641e/maintainability)](https://codeclimate.com/github/eggplants/get-twitter-shortened-url/maintainability)\n\n[![PyPI version](https://badge.fury.io/py/get-twitter-shortened-url.svg)](https://badge.fury.io/py/get-twitter-shortened-url)\n\n\n## `t_co` is…\n\n- Get shortened link(s) from [Twitter URL Shortener](https://help.twitter.com/en/using-twitter/url-shortener) ([t.co](https://t.co/))\n- Available on package \u0026 CLI\n\n## Install\n\n```bash\n$ pip install get-twitter-shortened-url\n```\n\n## Usage\n\n### from CLI\n\n```text\n$ t_co -h\nusage: t_co [-h] [-k key path] [--CK consumer key] [--CS consumer key secret]\n            [--AT accress token] [--AS access token secret] [-V]\n            url [url ...]\n\nShortened link from Twitter URL Shortener(t.co)\n\npositional arguments:\n  url                   Urls you want to shorten.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -k key path, --key_path key path\n                        Key file path (default: ~/.twitter.key)\n  --CK consumer key     Twitter consumer key.\n  --CS consumer key secret\n                        Twitter consumer key secret.\n  --AT accress token    Twitter access token.\n  --AS access token secret\n                        Twitter access token secret.\n  -V, --version         show program's version number and exit\n```\n\n```bash\n$ cat ~/.twitter.key\nCONSUMER_KEY=xxxxxxxxxxxxxxxxxxx\nCONSUMER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nACCESS_TOKEN_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\n$ t_co https://google.co.jp 'https://www.youtube.com/watch?v=-8OqFcLyA8o'\nhttps://google.co.jp =\u003e https://t.co/cpMOvCJCDU\nhttps://www.youtube.com/watch?v=-8OqFcLyA8o =\u003e https://t.co/pTZgns1Fas\n\n$ t_co 突うずるっ.com\n突うずるっ.com =\u003e https://t.co/5Z1CN94Hrb\n```\n\n### from package\n\n```python\nimport t_co\nCK, CS, AT, AS = '...', '...', '...', '...'\nt = t_co.Converter(CK, CS, AT, AS)\nt.shorten(['https://google.co.jp'])\n# =\u003e [{ 'url':          'https://t.co/cpMOvCJCDU',\n#       'expanded_url': 'https://google.co.jp/',\n#       'display_url':  'google.co.jp',\n#       'original_url': 'https://google.co.jp' }]\nt.shorten(['https://google.co.jp', 'https://www.youtube.com/watch?v=-8OqFcLyA8o'])\n# =\u003e [{ 'url':          'https://t.co/cpMOvCJCDU',\n#       'expanded_url': 'https://google.co.jp/',\n#       'display_url':  'google.co.jp',\n#       'original_url': 'https://google.co.jp' },\n#     { 'url':          'https://t.co/pTZgns1Fas',\n#       'expanded_url': 'https://www.youtube.com/watch?v=-8OqFcLyA8o',\n#       'display_url':  'youtube.com/watch?v=-8OqFc…',\n#       'original_url': 'https://www.youtube.com/watch?v=-8OqFcLyA8o' }]\n```\n\n### TIPS\n\n- Set the key using dotfile for security\n\n```python\nfrom os.path import expanduser, join\nimport os\nfrom dotenv import load_dotenv\n\nload_dotenv(join(expanduser(\"~\"), '.twitter.key'))\nCK, CS, AT, AS = [os.environ.get(_)\n                  for _ in (\n                    'CONSUMER_KEY', 'CONSUMER_SECRET',\n                    'ACCESS_TOKEN', 'ACCESS_TOKEN_SECRET')]\n```\n\n- Set keys on Terminal\n\n```bash\n$ export CONSUMER_KEY=xxxxxxxxxxxxxxxxxxx\n$ export CONSUMER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n$ export ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n$ export ACCESS_TOKEN_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\n## Development\n\n- local test\n\n```bash\n$ pytest -vv\n```\n\n- local CI test\n\n```bash\n$ act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04 --secret-file ~/.twitter.key\n```\n\n## LISENCE\n\nMIT\n\n## Author\n\neggplants (haruna)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggplants%2Fget-twitter-shortened-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggplants%2Fget-twitter-shortened-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggplants%2Fget-twitter-shortened-url/lists"}