Revision 6136f7c564a53a347b62694704199eb932e7e0ef authored by Jeremy Low on 20 January 2016, 01:52:01 UTC, committed by Jeremy Low on 20 January 2016, 01:57:35 UTC
1 parent 3442e17
url.py
#!/usr/bin/env python
class Url(object):
"""A class representing an URL contained in a tweet"""
def __init__(self,
url=None,
expanded_url=None):
self.url = url
self.expanded_url = expanded_url
@staticmethod
def NewFromJsonDict(data):
"""Create a new instance based on a JSON dict.
Args:
data:
A JSON dict, as converted from the JSON in the twitter API
Returns:
A twitter.Url instance
"""
return Url(url=data.get('url', None),
expanded_url=data.get('expanded_url', None))
Computing file changes ...