Commit a798c6f9 authored by Can Duruk's avatar Can Duruk
Browse files

Add a RawParser to access JSON objects directly

parent 33920f9f
......@@ -24,3 +24,4 @@ Thomas Bohmbach, Jr
Wayne Moore
Will McCutchen
Can Duruk
......@@ -7,7 +7,7 @@ import mimetypes
from tweepy.binder import bind_api
from tweepy.error import TweepError
from tweepy.parsers import ModelParser
from tweepy.parsers import ModelParser, RawParser
from tweepy.utils import list_to_csv
......@@ -77,7 +77,7 @@ class API(object):
allowed_param = ['id', 'count', 'page'],
require_auth = True
related_results = bind_api(
path = '/related_results/show/{id}.json',
......@@ -26,6 +26,18 @@ class Parser(object):
raise NotImplementedError
class RawParser(Parser):
def __init__(self):
def parse(self, method, payload):
return payload
def parse_error(self, payload):
return payload
class JSONParser(Parser):
payload_format = 'json'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment