Google Coop Blog RSS to XML Generator
UPDATE: Read this follow-up post to learn how to feed your Blog RSS to Google Co-op.
Scanning through Google Co-op Group, I came across a Google Co-op XML generator by 1000apps. Unfortunately, it uses words from the title instead of blog categories to generate the XML. So I’m going to have to rewrite it. This is the outline of my code (noting for myself, so I don’t have to think about it later):
- Parse Blog RSS using regexp; create a class for individual pages, store title, url, and categories per page. Store those classes in an array.
- Foreach item in the array, loop through categories. For each category, generate a Google co-op XML entry.
- write to output file, using the blog title as part of the url to avoid dup urls.
- done
Google XML entry structure:
<ResultSpec id=”CATCOUNT - TITLE”>
<Query>CATEGORYNAME</Query>
<Response>
<Output name=”title”>POSTORBLOGTITLE</Output>
<Output name=”more_url”>URL</Output>
<Output name=”text1″>DESCRIPTIONSNIPPET</Output>
</Response>
</ResultSpec>
Oh yeah, bracket the page with <Results>, </Results>
Note to self: Make sure I blog robots from the dir I dump the XML files.
It is kind of cool to show up at the top of Google search, even though only I can see it. If I do get around to rewriting that script, I’ll link to it from this blog.
What's Your Take?