Skip to content

Instantly share code, notes, and snippets.

@Leko
Last active April 1, 2016 08:59
Show Gist options
  • Save Leko/b89c2737034005c304b5d4c329fc9c73 to your computer and use it in GitHub Desktop.
Save Leko/b89c2737034005c304b5d4c329fc9c73 to your computer and use it in GitHub Desktop.
Chrome web store
#!/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