curl -sS https://gist.githubusercontent.com/Leko/b89c2737034005c304b5d4c329fc9c73/raw/c4b7d8a95b35fb4b8a7e8875b2d29d4496c87b78/cws > /usr/local/bin/cws
chmod +x /usr/local/bin/cws
cws
Last active
April 1, 2016 08:59
-
-
Save Leko/b89c2737034005c304b5d4c329fc9c73 to your computer and use it in GitHub Desktop.
Chrome web store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
CLIENT_ID=343618170190-6pikhp0vg6jak373ehpikpnc5f345lhn.apps.googleusercontent.com | |
CLIENT_SECRET=GJQBHNFQQSnMzA4h6_wLChMe | |
# For OSX | |
open "https://accounts.google.com/o/oauth2/auth?response_type=code&scope=https://www.googleapis.com/auth/chromewebstore&client_id=${CLIENT_ID}&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | |
# Read grant code from STDIN | |
echo 'Please enter grant code:' | |
read CODE | |
# Fetch access token | |
curl \ | |
-d "client_id=$CLIENT_ID" \ | |
-d "client_secret=$CLIENT_SECRET" \ | |
-d "code=$CODE" \ | |
-d "grant_type=authorization_code" \ | |
-d "redirect_uri=urn:ietf:wg:oauth:2.0:oob" \ | |
'https://accounts.google.com/o/oauth2/token' | |
echo 'Please enter access token:' | |
read TOKEN | |
open 'https://chrome.google.com/webstore/developer/dashboard' | |
echo 'Please enter application ID:' | |
read APP_ID | |
# Fetch detail of chrome extension | |
curl \ | |
-H 'Authorization: Bearer ya29..twIMMSiaaNhrSWgms2bKgTtdA0jGVuGxS8KJOivS3kHNkKdk1rvp8CVPDONOAFLcug' \ | |
-H 'x-goog-api-version: 2' \ | |
"https://www.googleapis.com/chromewebstore/v1.1/items/${APP_ID}?projection=DRAFT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment