Skip to content

Instantly share code, notes, and snippets.

@luigi
Created May 16, 2011 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luigi/974518 to your computer and use it in GitHub Desktop.
Save luigi/974518 to your computer and use it in GitHub Desktop.
Getting wikipedia URLs from TransparencyData.com
// First, query using the name of the company:
//
// http://transparencydata.com/api/1.0/entities.json?search=google&apikey=YOURKEY
[{"name": "Google Inc",
"count_given": 3897,
"firm_income": 0.0,
"count_lobbied": 31,
// ...snip...
"type": "organization",
"id": "7e716c3ba2244122b96a9dfaf60bfa70",
"non_firm_spending": 14870000.0
}]
// Then, use the id to get the full representation, with Wikipedia info being in the metadata section:
//
// http://transparencydata.com/api/1.0/entities/7e716c3ba2244122b96a9dfaf60bfa70.json?apikey=YOURKEY
"metadata": {
"bio": "<p>Google Inc. is an American multinational public corporation invested in Internet search, cloud computing, and advertising technologies. Google hosts and develops a number of Internet-based services and products, and generates profit primarily from advertising through its AdWords program. The company was founded by Larry Page and Sergey Brin, often dubbed the \"Google Guys\", while the two were attending Stanford University as Ph.D. candidates. It was first incorporated as a privately held company on September 4, 1998, and its initial public offering followed on August 19, 2004. At that time Larry Page, Sergey Brin, and Eric Schmidt agreed to work together at Google for twenty years, until the year 2024. The company's stated mission from the outset was \"to organize the world's information and make it universally accessible and useful\", and the company's unofficial slogan – coined by Google engineer Paul Buchheit – is \"Don't be evil\". In 2006, the company moved to their current headquarters in Mountain View, California.</p>",
"source_name": "wikipedia_info",
"bio_url": "http://en.wikipedia.org/wiki/Google",
"lobbying_firm": false,
"entity": "7e716c3ba2244122b96a9dfaf60bfa70",
"industry_entity": "fe29cfd5a3e34cab8dcdec22f1d06778",
"child_entities": [],
"parent_entity": null,
"photo_url": "https://s3.amazonaws.com/assets.transparencydata.org/resources/images/corporate_logos/200px-Googlelogo.png"
}
// Ruby gem: https://github.com/pengwynn/transparency-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment