MCPcopy Index your code
hub / github.com/clips/pattern / profile

Method profile

pattern/web/__init__.py:2368–2388  ·  view source on GitHub ↗

For the given author id or alias, returns a (id, name, date of birth, gender, locale)-tuple.

(self, id=None, **kwargs)

Source from the content-addressed store, hash-verified

2366 return results
2367
2368 def profile(self, id=None, **kwargs):
2369 """ For the given author id or alias,
2370 returns a (id, name, date of birth, gender, locale)-tuple.
2371 """
2372 url = FACEBOOK + (u(id or "me")).replace(FACEBOOK, "")
2373 url = URL(url, method=GET, query={"access_token": self.license})
2374 kwargs.setdefault("cached", False)
2375 kwargs.setdefault("unicode", True)
2376 kwargs.setdefault("throttle", self.throttle)
2377 try:
2378 data = URL(url).download(**kwargs)
2379 data = json.loads(data)
2380 except HTTP400BadRequest:
2381 raise HTTP401Authentication
2382 return (
2383 u(data.get("id", "")),
2384 u(data.get("name", "")),
2385 u(data.get("birthday", "")),
2386 u(data.get("gender", "")[:1]),
2387 u(data.get("locale", ""))
2388 )
2389
2390#--- PRODUCT REVIEWS -------------------------------------------------------------------------------
2391# ProductWiki is an open web-based product information resource.

Callers 1

11-facebook.pyFile · 0.80

Calls 4

URLClass · 0.85
setdefaultMethod · 0.45
downloadMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected