Commit 6b77b6d2 authored by Joshua Roesslein's avatar Joshua Roesslein
Browse files

Merge pull request #122 from cduruk/parser

Add a RawParser to access JSON objects directly
parents 0eec1f0f a798c6f9
......@@ -24,3 +24,4 @@ Thomas Bohmbach, Jr
Wayne Moore
Will McCutchen
gilles
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/show/:id.format"""
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):
pass
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