{"id":17402860,"url":"https://github.com/thlorenz/gapi-url","last_synced_at":"2025-10-11T16:18:50.625Z","repository":{"id":57244399,"uuid":"114479794","full_name":"thlorenz/gapi-url","owner":"thlorenz","description":"Small wrapper around Google Url Shortener API providing 'insert' and 'get' methods.","archived":false,"fork":false,"pushed_at":"2018-01-15T19:42:28.000Z","size":1203,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T20:03:59.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/thlorenz/gapi-url","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/thlorenz.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":"2017-12-16T17:52:55.000Z","updated_at":"2017-12-19T08:54:10.000Z","dependencies_parsed_at":"2022-09-01T04:23:19.934Z","dependency_job_id":null,"html_url":"https://github.com/thlorenz/gapi-url","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/thlorenz/gapi-url","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fgapi-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fgapi-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fgapi-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fgapi-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thlorenz","download_url":"https://codeload.github.com/thlorenz/gapi-url/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fgapi-url/sbom","scorecard":{"id":881856,"data":{"date":"2025-08-11","repo":{"name":"github.com/thlorenz/gapi-url","commit":"044ae96ce2e4bdda0abc0b3e1ec09f936a470138"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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/23 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":-1,"reason":"no workflows found","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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"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":"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"}}]},"last_synced_at":"2025-08-24T08:31:17.826Z","repository_id":57244399,"created_at":"2025-08-24T08:31:17.826Z","updated_at":"2025-08-24T08:31:17.826Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007787,"owners_count":26084364,"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-11T02:00:06.511Z","response_time":55,"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":[],"created_at":"2024-10-16T18:32:20.733Z","updated_at":"2025-10-11T16:18:50.585Z","avatar_url":"https://github.com/thlorenz.png","language":"JavaScript","readme":"# gapi-url [![build status](https://secure.travis-ci.org/thlorenz/gapi-url.svg?branch=master)](http://travis-ci.org/thlorenz/gapi-url)\n\nSmall wrapper around Google Url Shortener API providing 'insert' and 'get' methods.\n\n```js\nconst gapiUrl = require('gapi-url')\n\nconst API_KEY = '\u003cyour api key here\u003e'\n\n// Shorten a URL\nshortenURL(API_KEY, 'https://github.com', print)\n\nfunction printShortened(err, res) {\n  if (err) return console.error(err)\n  console.log('shortened url: ', res)\n  // =\u003e shortened url:  https://goo.gl/un5E\n}\n\n// Expand a shortened URL\nexpandURL(API_KEY, 'https://goo.gl/un5E', 'FULL', print)\n\nfunction print(err, res) {\n  if (err) return console.error(err)\n  console.log('expanded url: ', res)\n  // =\u003e expanded url: https://github.com\n}\n```\n\n## Installation\n\n    npm install gapi-url\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [API](#api)\n  - [shortenURL](#shortenurl)\n  - [expandURL](#expandurl)\n      - [Supported projections](#supported-projections)\n  - [getAnalyticsURL](#getanalyticsurl)\n    - [Example](#example)\n- [Resources](#resources)\n  - [Getting Started with the Google Shortener API](#getting-started-with-the-google-shortener-api)\n    - [API documented here](#api-documented-here)\n    - [Get API key](#get-api-key)\n    - [View Shortener Console](#view-shortener-console)\n    - [Testing with curl](#testing-with-curl)\n- [Kudos](#kudos)\n- [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## [API](https://thlorenz.github.io/gapi-url)\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### shortenURL\n\nShortens the provided url\n\n**Parameters**\n\n-   `apiKey` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** api key of your google application\n-   `link` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** that you want to shorten\n-   `cb` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** with following signature `function (err, shortenedLink)`\n\n### expandURL\n\nExpands the provided shortened url\n\n##### Supported projections\n\n-   ANALYTICS_CLICKS: Returns only click counts\n-   ANALYTICS_TOP_STRINGS: Returns only top string counts\n-   FULL: Returns the creation timestamp and all available analytics\n\n**Parameters**\n\n-   `apiKey` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** api key of your google application\n-   `shortened` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** link that you want to expand\n-   `projection` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** to include more info `ANALYTICS_CLICKS| ANALYTICS_TOP_STRINGS | FULL`\n-   `cb` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** with following signature `function (err, expanedLink)`\n-   `shortLink`  \n\n### getAnalyticsURL\n\nReturns the url for the google analytics page for the given\nshortened url.\n\n#### Example\n\n`getAnalyticsURL('https://goo.gl/un5E')`\n\n=\u003e \u003chttps://goo.gl/#analytics/goo.gl/un5E/all_time\u003e\n\n**Parameters**\n\n-   `url` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** shortened URL, i.e. obtained via shortenURL\n\nReturns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** link to the Google Analytics page.\n\n## Resources\n\n### Getting Started with the Google Shortener API\n\n#### API documented here\n\n    https://developers.google.com/url-shortener/v1/url\n\n[link](https://developers.google.com/url-shortener/v1/url)\n\n#### Get API key\n\n    https://developers.google.com/url-shortener/v1/getting_started\n\n[link](https://developers.google.com/url-shortener/v1/getting_started)\n\n#### View Shortener Console\n\n    https://console.developers.google.com/apis/api/urlshortener.googleapis.com/overview?project=gapi-url-1513446857763\u0026duration=PT1H\n\n[link](https://console.developers.google.com/apis/api/urlshortener.googleapis.com/overview?project=gapi-url-1513446857763\u0026duration=PT1H)\n\n#### Testing with curl\n\n    curl https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyA2LZbzpowavq0euPXmNhrSW6Q-R4-HnZA \\\n    -H 'Content-Type: application/json'                                                             \\\n    -d '{\"longUrl\": \"http://www.google.com/\" }'\n\n## Kudos\n\nThanks to @anvaka for his initial shortener implementation.\n\n-   [implementation inside fieldplay](https://github.com/anvaka/fieldplay/blob/2904a2a518dfa7bcb1929997134aef96907c1aea/src/lib/shortener.js)\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Fgapi-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthlorenz%2Fgapi-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Fgapi-url/lists"}