ONA / ONA13-Conference-Theme

A blast from the past; our theme from the 2013 ONA Conference
http://ona13.journalists.org
2 stars 0 forks source link

CLI importer for session data #22

Closed danielbachhuber closed 11 years ago

danielbachhuber commented 11 years ago

Once I complete #5, we'll want to automatically ingest and update the data from a Google Spreadsheet every five minutes or so.

This will be a WP-CLI command that inserts new sessions, or updates existing ones.

danielbachhuber commented 11 years ago

@jeremiahnpatterson Can you share the link to the Google Spreadsheet when you've created it?

jeremiahnpatterson commented 11 years ago

@danielbachhuber right now we have a draft spreadsheet, but it's been produced with our conference program committee in mind. We should probably chat about the best way to set up the final spreadsheet that we connect to WP?

danielbachhuber commented 11 years ago

Well, I can write an importer based on this spreadsheet too. Do you plan on maintaining two spreadsheets in the future, or just one?

Essentially, the spreadsheet should contain all of the fields we want to present on the website. I can draft a list of what that might be if you need something to work off.

Related: when are you and @anekola meeting to go over session page mockups? Can you post them to a Github issue when they're viewable so I can take a look too?

jeannebrooks commented 11 years ago

Thanks @danielbachhuber. We can use the sheet we created last year as a starter.

We're meeting with @anekola tomorrow afternoon to work on session page mockups and can post something after our meeting.

danielbachhuber commented 11 years ago

I got the importer to a workable state on my first flight today. Using "ONA12 Master Schedule v1b" as my test data, here's what it does:

  1. Reads data from a CSV that's set to a standard format.
  2. Writes the data to a custom post type.
  3. Makes the data available through an object.

It makes these assumptions:

If these assumptions are correct, we can use the importer to regularly update the site from the spreadsheet (both sessions and presenters).


@anekola here's a sense of how you might display the data in your templates:

$session = ONA_Session::get_by_session_id();
?>
<h2><?php echo $session->get_title(); ?></h2>
<p><?php echo $session->get_summary(); ?></p>

Seem reasonable?


@jeremiahnpatterson I'd love to get the session (and presenter) fields locked down so I can finish the importer up.

Here's what I have identified as expected fields (and values) for a session:

... and the same for presenter:

There's obviously a fair amount of data types missing (e.g. location). Can you mock up the spreadsheet we'll be using and add these fields?

jeannebrooks commented 11 years ago

We'd like to be able to display posts based on tags, does each tag need its own field?

danielbachhuber commented 11 years ago

@jeannebrooks You can have the tags in one cell as CSV.

@jeremiahnpatterson How are you coming along with the mock spreadsheet?