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
Raw File
hashtag.py
#!/usr/bin/env python


class Hashtag(object):
    """ A class representing a twitter hashtag """

    def __init__(self,
                 text=None):
        self.text = text

    @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.Hashtag instance
        """
        return Hashtag(text=data.get('text', None))
back to top