Open milh0use opened 6 years ago
DemocracyClub API notes:
https://candidates.democracyclub.org.uk/api/v0.9/
{
"persons": "http://candidates.democracyclub.org.uk/api/v0.9/persons/",
"organizations": "http://candidates.democracyclub.org.uk/api/v0.9/organizations/",
"posts": "http://candidates.democracyclub.org.uk/api/v0.9/posts/",
"elections": "http://candidates.democracyclub.org.uk/api/v0.9/elections/",
"party_sets": "http://candidates.democracyclub.org.uk/api/v0.9/party_sets/",
"images": "http://candidates.democracyclub.org.uk/api/v0.9/images/",
"post_elections": "http://candidates.democracyclub.org.uk/api/v0.9/post_elections/",
"memberships": "http://candidates.democracyclub.org.uk/api/v0.9/memberships/",
"logged_actions": "http://candidates.democracyclub.org.uk/api/v0.9/logged_actions/",
"extra_fields": "http://candidates.democracyclub.org.uk/api/v0.9/extra_fields/",
"simple_fields": "http://candidates.democracyclub.org.uk/api/v0.9/simple_fields/",
"complex_fields": "http://candidates.democracyclub.org.uk/api/v0.9/complex_fields/",
"person_redirects": "http://candidates.democracyclub.org.uk/api/v0.9/person_redirects/",
"council_elections": "http://candidates.democracyclub.org.uk/api/v0.9/council_elections/",
"candidate_results": "http://candidates.democracyclub.org.uk/api/v0.9/candidate_results/",
"post_results": "http://candidates.democracyclub.org.uk/api/v0.9/post_results/",
"result_sets": "http://candidates.democracyclub.org.uk/api/v0.9/result_sets/",
"candidates_for_postcode": "http://candidates.democracyclub.org.uk/api/v0.9/candidates_for_postcode/"
}
"id": 36012,
"url": "http://candidates.democracyclub.org.uk/api/v0.9/persons/36012/",
"name": "David Millican",
"other_names": [],
"identifiers": [
{
"identifier": "349734093",
"scheme": "twitter"
}
],
"honorific_prefix": "",
"honorific_suffix": "",
"sort_name": "",
"email": "david.millican@btinternet.com",
"gender": "male",
"birth_date": "",
"death_date": "",
"versions": [
{
"information_source": "https://www.ealingconservatives.org.uk/northfield",
"timestamp": "2018-04-19T21:33:56.834913",
"username": "milhouse",
"data": {
"facebook_page_url": "",
"name": "David Millican",
"honorific_suffix": "",
"party_ppc_page_url": "https://www.ealingconservatives.org.uk/person/cllr-david-millican-northfield",
"gender": "male",
"image": null,
"identifiers": [
{
"scheme": "twitter",
"identifier": "349734093"
}
],
"facebook_personal_url": "https://www.facebook.com/david.millican.73",
"honorific_prefix": "",
"twitter_username": "David_Millican",
"standing_in": {
"local.ealing.2018-05-03": {
"post_id": "LBW:E05000182",
"name": "Northfield"
}
},
"homepage_url": "",
"linkedin_url": "",
"extra_fields": {
"favourite_biscuits": ""
},
"wikipedia_url": "",
"party_memberships": {
"local.ealing.2018-05-03": {
"id": "party:52",
"name": "Conservative and Unionist Party"
}
},
"birth_date": "",
"email": "david.millican@btinternet.com",
"other_names": [],
"id": "36012",
"biography": "David is deeply committed to serving the Northfields community he has represented since 2006, and where he has lived, with his family, for over 35 years. He is passionate about improving the life chances of young people. He is a governor of two local schools, Fielding Primary School and the new Ealing Fields High School, and chairs the board of trustees of a local not-for-profit charity and social enterprise, Cultivate London, which employs young disadvantaged to improve the environment."
},
"version_id": "1c058c86b49bd55e"
},
{
"information_source": "Approved a photo upload from milhouse",
"timestamp": "2018-03-28T13:55:29.998038",
"username": "j0e_m",
"data": {
"facebook_page_url": "",
"name": "David Millican",
"other_names": [],
"honorific_suffix": "",
"party_ppc_page_url": "https://www.ealingconservatives.org.uk/person/cllr-david-millican-northfield",
"gender": "male",
"extra_fields": {
"favourite_biscuits": ""
},
"identifiers": [
{
"scheme": "twitter",
"identifier": "349734093"
}
],
"facebook_personal_url": "https://www.facebook.com/david.millican.73",
"id": "36012",
"standing_in": {
"local.ealing.2018-05-03": {
"post_id": "LBW:E05000182",
"name": "Northfield"
}
},
"honorific_prefix": "",
"linkedin_url": "",
"homepage_url": "https://www.ealingconservatives.org.uk/",
"twitter_username": "David_Millican",
"wikipedia_url": "",
"party_memberships": {
"local.ealing.2018-05-03": {
"id": "party:52",
"name": "Conservative and Unionist Party"
}
},
"birth_date": "",
"image": null,
"email": "",
"biography": ""
},
"version_id": "73f1d89391e4db65"
},
{
"information_source": "Conservative Leaflets",
"timestamp": "2018-03-27T19:53:53.289952",
"username": "milhouse",
"data": {
"facebook_page_url": "",
"name": "David Millican",
"honorific_suffix": "",
"party_ppc_page_url": "https://www.ealingconservatives.org.uk/person/cllr-david-millican-northfield",
"gender": "male",
"extra_fields": {
"favourite_biscuits": ""
},
"identifiers": [
{
"scheme": "twitter",
"identifier": "349734093"
}
],
"other_names": [],
"homepage_url": "https://www.ealingconservatives.org.uk/",
"email": "",
"honorific_prefix": "",
"standing_in": {
"local.ealing.2018-05-03": {
"post_id": "LBW:E05000182",
"name": "Northfield"
}
},
"facebook_personal_url": "https://www.facebook.com/david.millican.73",
"linkedin_url": "",
"twitter_username": "David_Millican",
"wikipedia_url": "",
"party_memberships": {
"local.ealing.2018-05-03": {
"id": "party:52",
"name": "Conservative and Unionist Party"
}
},
"birth_date": "",
"image": null,
"id": "36012",
"biography": ""
},
"version_id": "257ac68b976c5950"
}
],
"contact_details": [
{
"contact_type": "twitter",
"label": "",
"note": "",
"value": "David_Millican"
}
],
"links": [
{
"note": "facebook personal",
"url": "https://www.facebook.com/david.millican.73"
},
{
"note": "party candidate page",
"url": "https://www.ealingconservatives.org.uk/person/cllr-david-millican-northfield"
}
],
"memberships": [
{
"id": 155852,
"url": "http://candidates.democracyclub.org.uk/api/v0.9/memberships/155852/",
"label": "",
"role": "Candidate",
"elected": null,
"party_list_position": null,
"person": {
"id": 36012,
"url": "http://candidates.democracyclub.org.uk/api/v0.9/persons/36012/",
"name": "David Millican"
},
"organization": null,
"on_behalf_of": {
"id": "party:52",
"url": "http://candidates.democracyclub.org.uk/api/v0.9/organizations/party:52/",
"name": "Conservative and Unionist Party"
},
"post": {
"id": "LBW:E05000182",
"url": "http://candidates.democracyclub.org.uk/api/v0.9/posts/LBW:E05000182/",
"label": "Northfield",
"slug": "LBW:E05000182"
},
"start_date": null,
"end_date": null,
"election": {
"id": "local.ealing.2018-05-03",
"url": "http://candidates.democracyclub.org.uk/api/v0.9/elections/local.ealing.2018-05-03/",
"name": "Ealing local election"
}
}
],
"images": [
{
"id": 10926,
"url": "http://candidates.democracyclub.org.uk/api/v0.9/images/10926/",
"source": "Uploaded by milhouse: Approved from photo moderation queue",
"is_primary": true,
"md5sum": "41fd3f3c7452f40bceb82efa7c67959f",
"copyright": "profile-photo",
"uploading_user": "milhouse",
"user_notes": "",
"user_copyright": "profile-photo",
"notes": "Approved from photo moderation queue",
"image_url": "/media/images/images/36012.png",
"content_object": "http://candidates.democracyclub.org.uk/api/v0.9/persons/36012/"
}
],
"extra_fields": [
{
"key": "favourite_biscuits",
"value": "",
"type": "line"
}
],
"thumbnail": "http://candidates.democracyclub.org.uk/media/cache/a7/b0/a7b0c1a5748bc72938ab753fc69f2433.jpg"
}
{
"id": "party:107",
"url": "http://candidates.democracyclub.org.uk/api/v0.9/organizations/party:107/",
"name": "United Kingdom Unionist Party U.K.U.P.",
"other_names": [],
"identifiers": [
{
"identifier": "party:107",
"scheme": "popit-organization"
},
{
"identifier": "PP107",
"scheme": "electoral-commission"
}
],
"classification": "Party",
"parent": null,
"founding_date": "1999-01-14",
"dissolution_date": "2008-09-04",
"contact_details": [],
"images": [],
"links": [],
"sources": [],
"register": "Northern Ireland",
"party_sets": [
{
"id": 2,
"url": "http://candidates.democracyclub.org.uk/api/v0.9/party_sets/2/",
"name": "Northern Ireland",
"slug": "ni"
}
]
},
Given a ward, find a candidate with a Twitter handle. Add all their friends to a collection of Twitter handles for their party in their council area. Then for each other candidate in that party and council area, check the collection for matches.