'FQL query.
Two reasons to have this method:
1. Graph api does not expose some info fields of a user, e.g.
a user\'s networks/affiliations, we have to fall back to old api.
2. FQL is a strong tool.
Example query: "SELECT affiliations FROM user WHERE uid = me()"'

def fql(self, query, args=None, post_args=None):

    if (not args):
        args = {}
    if self.access_token:
        if (post_args is not None):
            post_args['access_token'] = self.access_token
        else:
            args['access_token'] = self.access_token
    post_data = (None if (post_args is None) else urllib.urlencode(post_args))
    args['query'] = query
    args['format'] = 'json'
    file = urllib2.urlopen(('https://api.facebook.com/method/fql.query?' + urllib.urlencode(args)), post_data)
    try:
        content = file.read()
        response = _parse_json(content)
        if ((type(response) is dict) and ('error_code' in response)):
            raise GraphAPIError(response['error_code'], response['error_msg'])
    except Exception as e:
        raise e
    finally:
        file.close()
    return response
