View Full Version : NewsChat.TV - Need TV Guide Listing API Import to Wordpress Post Schedule

03-03-2011, 12:02 PM
I built a skeleton website: http://www.newschat.tv

The site is functional - logged in users click on the name and date of the show they are watching and can chat in realtime or leave static comments about the show. But presently each post for each show needs to be entered manually.

Notice @ post permalink: http://newschat.tv/bbc/03-02-11-1600-bbc-world-news-america/ chatbox appears.

Each post (news program) has its own chat.

I would like to pull data from a tv guide API in pacific time zone for generic news show listings.

- pull title of show. add to date and time PST and create wordpress post with title format: '03.02.11 16:00 BBC World News America'
- pull network and make it the WP post category (i.e. 'Posted in BBC')
- pull show title and make it the WP post tag (i.e. 'Tagged BBC World News America')
- pull show air time and set WP post schedule to post 2 hours prior.

The effect being that there is a post created for each news show that comes on TV 2 hours before it airs in PST. People come and chat whenever it comes on in their time zone.

Here are my leads so far:

... but this part is over my head. What I would like to do is automate and monetize this. Then I'd like to split the revenue with whomever helps me automate it. PM me if interested. Or if you happen to have any suggestions or resources to figure this out I'd appreciate it!

03-03-2011, 01:19 PM
The data is available in XML. So some grabber that strips out the relevant information and disregards the rest. If the data has some sort of 'category' like news, then it can first drop all the ones that aren't in the category - but if it does not, might have to pre-select show titles to look for.

I'm guessing this is fairly simple - but like I say over my head. Is it possible to just create an email for each post, and send it to posterous.com - then have posterous autopost to wordpress? Or perhaps a new WP plugin is needed.

03-03-2011, 02:03 PM
With a subscription to http://www.schedulesdirect.org and the XMLTV Project tools, it looks like I'll be able to get an XML file output that filters out the unnecessary information, but still testing.

XMLTV uses tv_grab_na_dd for north american listings, and outputs an XML file. tv_check checks the listings for changes to your selected program list.

The next step would be to get the data in that XML file into a wordpress post. If there's no XML to Wordpress plugin, code might use XML-RPC. Anybody worked with this stuff before?

03-03-2011, 03:24 PM
Here's a sample entry from the xml data output:

<programme start="20110303030000 -0800" stop="20110303060000 -0800" channel="I10139.labs.zap2it.com">
<title lang="en">Squawk Box</title>
<desc lang="en">A rare TV interview with Ray Dalio; Sam Zell.</desc>
<presenter>Mark Haines</presenter>
<category lang="en">Bus./financial</category>
<category lang="en">News</category>
<category lang="en">Public affairs</category>
<category lang="en">Series</category>
<episode-num system="dd_progid">EP00159893.0134</episode-num>
<subtitles type="teletext" />

where 'programme'/'category' == 'bus./finacial' or 'news' or 'public affairs' grab info and write to xmloutputclean.xml

how to do this?

03-03-2011, 04:39 PM
Alright another idea: Have users create the new posts/shows they want to chat about. drop down boxes for time zone, network, is live/isn't, and text area for 'name of show' with 'or select commonly used shows.' I'm picturing this as a wordpress plugin solution.

03-03-2011, 06:13 PM
Well I think this is simpler:

With WP Plugin Custom Contact Forms (http://taylorlovett.com/wordpress-plugins) I made a 'submit news show (http://newschat.tv/make-a-new-chatroom/)' page.

This gives me an email with the following text in it:

date: 04.22.2019
Network: HBO
Title: Ron Paul Presents

So I need to edit the output to email or remove the 'date: ' etc before forwarding it to a wordpress service to create a post. then wp-twitter or similar can send it on to twitter, wordbooker can send it to facebook. Or perhaps I can figure out how to create an email out of the output to forward to posterous.com... and have it auto-post to twitter/facebook from there.

Any idea how to remove the 'date: ' etc? I think the easiest way will be through the Custom Contact plugin, but I haven't found it. I expected an option: 'email format' where there would be a %d or similar. Looking around for the snippet that controls the format of the email sent by the WP Custom Contact Plugin...

03-03-2011, 06:53 PM
This is all I can find in the readme:

Form Action: This allows you to process your forms using 3rd party services or your own scripts. If you don't know what this is, then leave it blank. This is useful if you use a service like Aweber or InfusionSoft.And I've yet to find a similar problem on the support forums. But I posted a thread (http://wordpress.org/support/topic/giving-the-email-a-custom-subject-based-on-form-entry?replies=1#post-1979205).

I'm trying to use this plugin to let users create a post to the blog. I want the dropdown boxes and text fields of the form to become the subject and the content of the email. So I then can forward it to posterous.com and have it auto-post a wordpress post, a facebook post, and a twitter post. For instance: user enters a date and the subject of the email has the date in it. Some %d solution?
More info: http://www.ronpaulforums.com/showthread.php?282224-NewsChat.TV-Need-TV-Guide-Listing-API-Import-to-Wordpress-Post-Schedule