This is now replaced by a version in the YourNextRepresentative repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
GREEN=$(tput setaf 2) | |
RESET=$(tput sgr0) | |
export GIT_PAGER=cat | |
for d in * | |
do | |
if [ -d "$d" ] || [ -L "$d" ] |
I hereby claim:
- I am mhl on github.
- I am mhl (https://keybase.io/mhl) on keybase.
- I have a public key whose fingerprint is 74D7 CE8D ADB3 E542 93A5 D25D FEBF 4CC4 8EE8 9E5A
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import os | |
from subprocess import check_call | |
from lxml import etree | |
if len(sys.argv) != 2: | |
print >> sys.stderr, "Usage: %s [EMX-FILE]" % (sys.argv[0]) | |
sys.exit(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/data/all-parties-from-popit.json b/data/all-parties-from-popit.json | |
index 8f97cf7..b313e9f 100644 | |
--- a/data/all-parties-from-popit.json | |
+++ b/data/all-parties-from-popit.json | |
@@ -1260,21 +1260,21 @@ | |
"slug": "the-monmouth-party" | |
}, | |
{ | |
"classification": "Party", | |
"contact_details": [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
===================================================== | |
3 party:103 Alliance - Alliance Party of Northern Ireland | |
-- | |
Emblem 1 | |
http://yournextmp.popit.mysociety.org/organizations/party:103/image/54ce61a895590a102032012e | |
-- | |
Emblem 2 | |
http://yournextmp.popit.mysociety.org/organizations/party:103/image/54ce61a895590a102032012f | |
-- | |
Emblem 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: from candidates.static_data import MapItData | |
In [2]: from candidates.popit import create_popit_api_object | |
In [3]: api = create_popit_api_object() | |
In [4]: scottish_cons = [m['id'] for m in MapItData.constituencies_2010.values() if m['country'] == 'S'] | |
In [15]: for post_id in scottish_cons: | |
....: p = api.posts(str(post_id)).get(embed='membership.person')['result'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var popitURL = 'http://za-new-import.popit.mysociety.org/api/v0.1'; | |
var today = new Date().toISOString().substring(0, 10); | |
function endDateAfter(endDate, whenDate) { | |
if (!endDate) { | |
/* A falsy endDate indicates that the end date is 'future' */ | |
return true; | |
} | |
return endDate > whenDate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import mailbox | |
import os | |
import re | |
from subprocess import check_output | |
import sys | |
top_level_mail_directory = os.path.join(os.environ['HOME'], 'Mail') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.contenttypes.models import ContentType | |
from pombola.core.models import OrganisationKind | |
for ok in OrganisationKind.objects.filter(name__icontains='committee'): | |
print ok | |
for o in ok.organisation_set.all(): | |
print " ", o | |
for i in Identifier.objects.filter( | |
object_id=o.id, | |
content_type=ContentType.objects.get_for_model(Organisation) |