def tweet_generic_graph(self, data_frame, adapter =  default_adapter, type = 'line', gp = None, twitter_msg = None, twitter_on = None):
        self.plot_generic_graph(data_frame, type = type, adapter = adapter, gp = gp)

        twitter = TwitterPyThalesians()
        twitter.auto_set_key()

        if twitter_on: twitter.update_status(twitter_msg, picture = gp.file_output)
    def tweet_generic_graph(self, data_frame, adapter =  default_adapter, type = 'line', gp = None, twitter_msg = None, twitter_on = None):
        self.plot_generic_graph(data_frame, type = type, adapter = adapter, gp = gp)

        twitter = TwitterPyThalesians()
        twitter.auto_set_key()

        if twitter_on: twitter.update_status(twitter_msg, picture = gp.file_output)
"""
twitterpythalesians_examples

Gives example of how to update Twitter status with text and plot directly (as opposed to via PlotFactory)

"""

from pythalesians.util.twitterpythalesians import TwitterPyThalesians

if True:
    APP_KEY             = "XXXX"
    APP_SECRET          = "XXXX"
    OAUTH_TOKEN	        = "XXXX"
    OAUTH_TOKEN_SECRET	= "XXXX"

    pytwitter = TwitterPyThalesians()
    pytwitter.set_key(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)

    from pythalesians.market.requests.timeseriesrequest import TimeSeriesRequest
    from pythalesians.market.loaders.lighttimeseriesfactory import LightTimeSeriesFactory

    import datetime

    from pythalesians.graphics.graphs.plotfactory import PlotFactory
    from pythalesians.graphics.graphs.graphproperties import GraphProperties

    end = datetime.datetime.utcnow()
    start_date = end.replace(hour=0, minute=0, second=0, microsecond=0) # Returns a copy

    time_series_request = TimeSeriesRequest(
                start_date = start_date,         # start date
Exemple #4
0
"""
twitterpythalesians_examples

Gives example of how to update Twitter status with text and plot directly (as opposed to via PlotFactory)

"""

from pythalesians.util.twitterpythalesians import TwitterPyThalesians

if True:
    APP_KEY = "XXXX"
    APP_SECRET = "XXXX"
    OAUTH_TOKEN = "XXXX"
    OAUTH_TOKEN_SECRET = "XXXX"

    pytwitter = TwitterPyThalesians()
    pytwitter.set_key(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)

    from pythalesians.market.requests.timeseriesrequest import TimeSeriesRequest
    from pythalesians.market.loaders.lighttimeseriesfactory import LightTimeSeriesFactory

    import datetime

    from pythalesians.graphics.graphs.plotfactory import PlotFactory
    from pythalesians.graphics.graphs.graphproperties import GraphProperties

    end = datetime.datetime.utcnow()
    start_date = end.replace(hour=0, minute=0, second=0,
                             microsecond=0)  # Returns a copy

    time_series_request = TimeSeriesRequest(