{"id":17492037,"url":"https://github.com/waynechang65/deno-unlimited-bitly","last_synced_at":"2026-04-18T17:37:44.343Z","repository":{"id":57675550,"uuid":"400841216","full_name":"WayneChang65/deno-unlimited-bitly","owner":"WayneChang65","description":"🦕 deno-unlimited-bitly(unlimited_bitly) is a module which can combine many Bitly accounts together to be an extensible quota usage.","archived":false,"fork":false,"pushed_at":"2021-09-23T16:22:25.000Z","size":281,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T03:24:35.008Z","etag":null,"topics":["bitly","deno","quota","unlimited"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/WayneChang65.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-08-28T16:37:04.000Z","updated_at":"2023-03-22T05:48:55.000Z","dependencies_parsed_at":"2022-09-15T05:41:06.429Z","dependency_job_id":null,"html_url":"https://github.com/WayneChang65/deno-unlimited-bitly","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneChang65%2Fdeno-unlimited-bitly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneChang65%2Fdeno-unlimited-bitly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneChang65%2Fdeno-unlimited-bitly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneChang65%2Fdeno-unlimited-bitly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WayneChang65","download_url":"https://codeload.github.com/WayneChang65/deno-unlimited-bitly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246068302,"owners_count":20718503,"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":["bitly","deno","quota","unlimited"],"created_at":"2024-10-19T08:07:02.848Z","updated_at":"2026-04-18T17:37:44.315Z","avatar_url":"https://github.com/WayneChang65.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno-unlimited-bitly  \n\u003ca href=\"https://github.com/waynechang65/deno-unlimited-bitly/tags/\"\u003e\u003cimg src=\"https://img.shields.io/github/tag/waynechang65/deno-unlimited-bitly\" alt=\"Current version\" /\u003e\u003c/a\u003e \u003ca href=\"https://github.com/denoland/deno/blob/main/Releases.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/deno-1.14.0-brightgreen?logo=deno\" alt=\"Minimum supported Deno version\" /\u003e\u003c/a\u003e \u003ca href=\"https://GitHub.com/waynechang65/deno-unlimited-bitly/graphs/commit-activity\"\u003e\u003cimg src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" alt=\"deno-unlimited-bitly is maintained\" /\u003e\u003c/a\u003e \u003cimg src=\"https://img.shields.io/github/license/waynechang65/deno-unlimited-bitly\" alt=\"deno-unlimited-bitly license\" /\u003e \u003ca href=\"https://nest.land/package/deno-unlimited-bitly\"\u003e\u003cimg src=\"https://nest.land/badge.svg\" alt=\"Published on nest.land\" /\u003e\u003c/a\u003e  \n\u003cimg align=\"right\" src=\"https://deno.land/logo.svg\" height=\"80px\" width=\"80\" alt=\"the deno mascot dinosaur standing in the rain\"\u003e  \n\ndeno-unlimited-bitly 是一個將**多個**[Bitly](https://bitly.com)帳號的轉短址額度結合起來而成為**一個較大且幾乎可無限擴充額度容量**的模組。**此模組必須運行在[Deno](https://deno.land/)相容的環境中**。  \ndeno-unlimited-bitly is a module which can **combine many [Bitly](https://bitly.com) accounts together** to be an extensible quota usage. This module has to run in a [Deno](https://deno.land/) compatible environment.  \n\n## 前言(Overview)\n[Bitly](https://bitly.com)是很常被使用來將長網址轉成短網址的服務商，且有提供免費轉短網址服務。不過，免費帳號每個月只有1000個連結轉址的額度。如果有機會每個月使用超過1000個轉址額度，就可以使用本模組將多個帳號(包含付費與免費帳號)結合起來一併使用。  \n\n[Bitly](https://bitly.com) is a service provider that is often used to convert long URLs into short, and also offers free service. However, the free account has only 1000 links for re-directing each month. If you need to use more than 1000 links quotas per month, you can use this module to combine multiple accounts(including paid and free accounts) as one.  \n\n## 這個模組能做什麼事？ (What can it do ?)\n* 將多個帳號的轉址額度合併使用，跟使用單一帳號一樣簡單。    \nCombine multiple Bitly accounts to use as one account easy.\n\n## 如何在您的專案使用？ (How to use it in your project ?)\n* 直接於deno程式中，以關鍵字**import**引用  \nUse the moudle by **import** in deno's program for [deno.land](https://deno.land/) or [nest.land](https://nest.land/).  \n```javascript  \nimport { init, shorten, getAccountsStatus } from 'https://deno.land/x/unlimited_bitly@v1.0.2/mod.ts'\n```  \nOR\n```javascript  \nimport { init, shorten, getAccountsStatus } from 'https://x.nest.land/deno-unlimited-bitly@v1.0.2/mod.ts'\n```  \n* 接下來，用下面幾行程式就搞定了。值得注意的是，BITLY_KEYS陣列要放Bitly帳號的KEY，放幾個帳號都可以。(以下範例是4個帳號)  \nAdd programs below in your project. It should be mentioned that please put keys of Bitly accounts in BITLY_KEYS array.(example shows below by 4 Bitly accounts)  \n\n```javascript  \nconst BITLY_KEYS = [  \n\tDeno.env.get('TOSMM_BITLY_1_KEY'),  \n\tDeno.env.get('TOSMM_BITLY_2_KEY'),  \n\tDeno.env.get('TOSMM_BITLY_3_KEY'),  \n\tDeno.env.get('TOSMM_BITLY_4_KEY')  \n];  \n\ninit(BITLY_KEYS);  \n\nconst longUrl = 'https://github.com/WayneChang65';  \nlet shortUrl = await shorten(longUrl);  \nconsole.log(shortUrl);  \n```  \n\n* shorten函式會傳回已縮完的短網址。  \nThe function \"shorten\" will return a shortened url.  \n\n* 執行時，必須加上```--allow-net```將網路存取權限打開。  \nWhen run the module, ```--allow-net``` has to be added in the running command to allow using the net.  \n\n## 如何跑範例程式？ (How to run the example ?)  \n### 從Github下載程式碼。 Download source code from Github.  \n* 從GitHub下載deno-unlimited-bitly專案程式  \nClone deno-unlimited-bitly from GitHub  \n```  \ngit clone https://github.com/WayneChang65/deno-unlimited-bitly.git  \n```  \n\n* 將Bitly Key增加TOSMM_BITLY_1_KEY-TOSMM_BITLY_4_KEY的環境變數中。  \nAdd Bitly Key to env variables(TOSMM_BITLY_1_KEY~TOSMM_BITLY_4_KEY).  \n\n* 透過使用以下指令執行demo程式。(demo.js)  \nRun it with command below. (demo.js)  \n```  \ndeno run --allow-net --allow-env demo.js  \n```  \n![image](https://raw.githubusercontent.com/WayneChang65/deno-unlimited-bitly/master/img/001.png)  \n\n### 直接使用Deno遠端引入檔案執行。 Run it directly by internet.  \n```  \ndeno run --allow-net --allow-env https://deno.land/x/unlimited_bitly/demo.js  \n```  \n![image](https://raw.githubusercontent.com/WayneChang65/deno-unlimited-bitly/master/img/002.png)  \n  \n## 基本函式 (Base Methods)  \n* init(BITLY_KEYS): 初始化物件(BITLY KEYs 陣列), initialize deno-unlimited-bitly object(BITLY KEYs Array)  \n* shorten(longUrl, option): 進行取得短網址, get shortened url  \n  * `longUrl`: 欲縮成短網址的長網址。long url which wants to shorten  \n  * `option`: 可以設定custom domain以及group_guid。it can set option for custom domain and group_guid.  \n\n* getAccountsStatus(): 取得所有帳號的狀態, get all accounts status  \n  * return object {valid, total}:  \n    * `valid`: 有效帳號個數, number of valid accounts  \n    * `total`: 所有帳號個數, number of total accounts  \n\n## 參考網站 (Reference)  \n* [Bitly](https://bitly.com)  \n\n## 貢獻一己之力 (Contribution)  \ndeno-unlimited-bitly 雖然是一個小模組，但本人還是希望這個專案能夠持續進步！若有發現臭蟲(bug)或問題，請幫忙在Issue留言告知詳細情形。  \n歡迎共同開發。歡迎Fork / Pull Request，謝謝。:)  \n\nEven though deno-unlimited-bitly is a small project, I hope it can be improving. If there is any issue, please comment and welcome to fork and send Pull Request. Thanks. :)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaynechang65%2Fdeno-unlimited-bitly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaynechang65%2Fdeno-unlimited-bitly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaynechang65%2Fdeno-unlimited-bitly/lists"}