Skip to content

Instantly share code, notes, and snippets.

@jasonbaker
Created October 5, 2011 22:25
Show Gist options
  • Save jasonbaker/1265928 to your computer and use it in GitHub Desktop.
Save jasonbaker/1265928 to your computer and use it in GitHub Desktop.
>>> from apture.main.util import wikipedia
>>> article = wikipedia.wikipediaItemFromTitle('Barack Obama')
>>> dir(article)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_isNSFW', '_itemFields', '_props', 'acceptableImageExtensions', 'category', 'data', 'full', 'hash', 'iconPos', 'id', 'introText', 'isNSFW', 'jsClassName', 'jsClassNames', 'jsProperties', 'key', 'name', 'newFromJSSerializedProperties', 'newFromSerializedProperties', 'parentHash', 'posterImage', 'prettySource', 'promote', 'rank', 'rawItem', 'sanitizeInput', 'serializedProperties', 'sourceIndex', 'statsCategory']
>>> dir(article.rawItem)
['DoesNotExist', 'IGNORED_PREFIXES', 'MEDIAWIKI_URL', 'Meta', 'VERSION', '__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', '__unicode__', '__weakref__', '_checkedCached', '_connectIntraArticleLinks', '_fetchHTMLFromRPC', '_fetchHTMLMediaWiki', '_getKey', '_getPlaceholderData', '_getPlaceholderHandle', '_getProvider', '_isNSFW', '_itemFields', '_keys', '_loadData', '_loadFromCacheData', '_loaded', '_parseSections', '_props', '_setKey', '_trustTitle', 'addIndexes', 'adsOkay', 'baseUrl', 'cacheKey', 'cacheSeconds', 'canonical', 'category', 'className', 'classNameProp', 'cleanTitle', 'clearFromCache', 'description', 'displayProperties', 'extLinkSectionHeader', 'faviconUrl', 'fetchCanonicalItem', 'fetchHTML', 'flexibleSize', 'get', 'getAptureRef', 'getAutoEnhanceDescription', 'getCanonicalItem', 'getCanonicalTitle', 'getDisplayProperties', 'getImages', 'getKeyPropValueClassName', 'getPlaceholderUrl', 'getProvider', 'getSectionByTitle', 'getSections', 'getTopImage', 'hasConnectedItems', 'height', 'id', 'invalidateJSCache', 'isCanonical', 'isNSFW', 'isTitleValid', 'itemFromJS', 'items', 'jsClassName', 'jsClassNames', 'jsExtraProperties', 'jsProperties', 'key', 'lang', 'license', 'loadFromCache', 'lookupCanonicalItem', 'lookupExactItem', 'main', 'mainProperties', 'mediaitems', 'newFromAptureRef', 'newFromJSSerializedProperties', 'newFromRegexMatch', 'newFromSerializedProperties', 'newFromUrl', 'notFound', 'prefetch', 'prettySource', 'previewUrl', 'promotable', 'queryWikipediaAPI', 'rank', 'refSectionHeader', 'regexPriority', 'relationForWikipedia', 'relationsSavedTime', 'row', 'sanitizeInput', 'save', 'saveOrLookup', 'saveRelations', 'sectionType', 'serializedProperties', 'setDisplayProperties', 'shortSnippet', 'shouldPromote', 'sourceIndex', 'sourceUrl', 'statsCategory', 'title', 'topical', 'unicodeTitle', 'update', 'viewWithoutCanonical', 'width']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment