Created
July 23, 2015 08:47
-
-
Save wozozo/f81aa1abbe57b2918abe to your computer and use it in GitHub Desktop.
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
# 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