Skip to content

Instantly share code, notes, and snippets.

@wozozo
Created July 23, 2015 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wozozo/f81aa1abbe57b2918abe to your computer and use it in GitHub Desktop.
Save wozozo/f81aa1abbe57b2918abe to your computer and use it in GitHub Desktop.
# coding: utf-8
import json
import requests
class Chimpo(object):
endpoint = 'http://chimpo.co/shortener/v1'
"""docstring for Chimpoco"""
def __init__(self):
super(Chimpo, self).__init__()
def co(self, url):
response = requests.post(self.endpoint, json.dumps({'url': url}))
return json.loads(response.content.decode('utf-8'))
def main():
chimpo = Chimpo()
print(chimpo.co('http://garsue.fm/'))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment