예제 #1
0
파일: fetch.py 프로젝트: marklar/massiu
def account(account_name=ACCOUNT_NAME):
    """
    :: String -> Response data
    Provides meta info for all streams in a single request.
    """
    url = account_url(account_name)
    payload = {}
    return reqs.get_data(url, payload)
예제 #2
0
파일: fetch.py 프로젝트: marklar/massiu
def stream(stream_name, account_name=ACCOUNT_NAME, start_id=None, limit=200):
    url = stream_url(account_name, stream_name)
    payload = {
        'start_id': start_id,
        'reverse': False,  # False: oldest come first.
        'replies': True,   # If reply, include orig Tweet in 'in_reply_to'?
        'limit': limit     # Default: 50.  Max: 200.
    }
    return reqs.get_data(url, payload)
예제 #3
0
파일: youtube.py 프로젝트: marklar/massiu
def new_get_data(username):
    url = "https://www.googleapis.com/youtube/analytics/v1/reports"
    metrics = [
        'views',
        'comments',
        'favoritesAdded',
        'likes',
        'dislikes',
        'estimatedMinutesWatched'
    ]
    params = {
        'ids': 'channel%3D%3D' + username,
        'metrics': '%2C'.join(metrics),
        'key': SERVER_API_KEY
    }
    return reqs.get_data(url, params)
예제 #4
0
파일: fetch.py 프로젝트: marklar/massiu
def meta(stream_name, account_name=ACCOUNT_NAME, num_minutes=MINS_IN_DAY):
    """
    :: String, String -> Response data
    activity:
      num_minutes: how many 'minute'
      num_days: how many 'daily'
    advanced:
      num_trends: "trends" - number of top and total trends
      num_hashtags: "hashtag tracking" - number of developing hashtags
      num_contributors: "contributor tracking" - number of top contributor handles
    """
    url = meta_url(account_name, stream_name)
    payload = {
        'activity': 1,   # activity & count properties
        'num_hours': 1,
        'num_minutes': num_minutes,
        'num_days': 1,
        'sources': 1,  # shows keywords!
        'networks': True,
        'num_contributors': 5  # not enabled
    }
    return reqs.get_data(url, payload)
예제 #5
0
파일: facebook.py 프로젝트: marklar/massiu
def get_likes(username):
    resp = reqs.get_data(URL_ROOT + username, {})
    return dict([(k, get_or_none(resp, k))
                 for k in KEYS])