Difference between revisions of "OpenAid"

From WPUK wiki
Jump to: navigation, search
(Components of the solution)
(Components of the solution)
Line 31: Line 31:
 
Exported XML
 
Exported XML
 
<pre>
 
<pre>
<project>
+
<project code='' uri=''>
 
+
    <title />
 
+
    <country />
 
+
    <description />
 +
    <sectors>
 +
        <sector group='' name='' />
 +
    </sectors>
 +
    <budget />
 +
    <expenditure />
 
</project>
 
</project>
 
</pre>
 
</pre>
  
 +
Credit: @wordhackuk, @paulbunkham
  
 
'''2. Import XML into WordPress'''
 
'''2. Import XML into WordPress'''
 
Simple rules...in pseudocode
 
Simple rules...in pseudocode
  
 +
<nowiki>
 
if the project already exists (project code exists)
 
if the project already exists (project code exists)
 
     if content has changed
 
     if content has changed
Line 47: Line 54:
 
else
 
else
 
     create a new project
 
     create a new project
 +
</nowiki>
  
 
+
Credit: @cnorthwood
  
 
'''3. Custom Post Type'''
 
'''3. Custom Post Type'''
 
The custom post type will contain
 
The custom post type will contain
 +
 
  * Project (component) code
 
  * Project (component) code
 
  * Project (component) title
 
  * Project (component) title
Line 60: Line 69:
 
  ** Total approved budget
 
  ** Total approved budget
 
  ** Actual expenditure to date
 
  ** Actual expenditure to date
 +
 +
Credit: @iamfriendly
  
 
'''4. Theme'''
 
'''4. Theme'''
 
Theme to improve UX, to include mobile theme for use by citizens of developing countries.
 
Theme to improve UX, to include mobile theme for use by citizens of developing countries.
 +
 +
Credit: @madhavaji
 +
 +
'''5. Comments related to revisions'''
  
 
== Developers ==
 
== Developers ==

Revision as of 08:09, 17 July 2010

Idea 5 for WordHack 2010 was an Open Aid Projects site, built in WordPress, that imported data from DFID's

Original idea: IDEA 5: Commentable WordPress site based on Government data

Transparency is one of the high priorities of the new UK government and the Prime Minister has promised that government will publish a wide range of datasets by the end of 2010. The Department for International Development (disclosure: where I work) has promised to release reusable data on UK aid projects by January 2011.

This WordHack would attempt to create a commentable WordPress site based on XML data from DFID (this is not the final data format, but would be good enough for a WordHack protoype). The aim of the site would be to allow the public in both the UK and developing countries to comment on specific DFID projects.

I'd like to:

  1. Create a new Custom Post Type for a DFID Project, to capture the key project attributes released in the XML file.
  2. Write a plugin to parse the XML and to create a Post for each <project> node in the XML file, and populate the correct custom metadata. Also populate tags and categories based on project attributes (e.g. country, region, aid sector).
  3. Have an "update content" button that can add new nodes when the XML file is updated.

Initial research This WordPress Support thread contains a very rough example of a plugin to import XML and create a post with post attributes. May give us some ideas, although not configured for a Custom Post Type.

The FeedWordPress plugin may also provide some ideas, although I notice that it's broken in 3.0.

Personal note: this WordHack would join both my day job in DFID with my interest in WordPress - this is a very topical issue and could have other applications across government datasets.

Originator: John Adams (@johnthegeo) Team members: Shaun Hare (@wordhackuk),


Components of the solution

1. XML Transform Pulling XML from DFID source data, transforming to the target XML structure. Adds meaningful content for both country and sector information, based on lookup xml files.

Exported XML

<project code='' uri=''>
    <title />
    <country />
    <description />
    <sectors>
        <sector group='' name='' />
    </sectors>
    <budget />
    <expenditure />
</project>

Credit: @wordhackuk, @paulbunkham

2. Import XML into WordPress Simple rules...in pseudocode

if the project already exists (project code exists) if content has changed update content, create new post revision else create a new project

Credit: @cnorthwood

3. Custom Post Type The custom post type will contain

* Project (component) code
* Project (component) title
* Project purpose (description)
* Country
* Input Sector(s)
* Financial
** Total approved budget
** Actual expenditure to date

Credit: @iamfriendly

4. Theme Theme to improve UX, to include mobile theme for use by citizens of developing countries.

Credit: @madhavaji

5. Comments related to revisions

Developers

@madhavaji

@iamfriendly

@cnorthwood

@kieranoshea

@paulbunkham

@wordhackuk

@johnthegeo

Possible future extensions

BuddyPress to create a commenting community, with alerts and a registration of interest

Comment versions metadata

Retrieved from "?title=OpenAid&oldid=2107"