In a previous post, I had written an example of combining two RSS feeds into one. At some point, I lost the code from the example, probably from clicking save one-too-many times in WordPress. WordPress is quite finicky about posting any kind of programming code. I did some research, and found PasteBin, and have started using that for my code samples.
With that out of the way, it’s time to rewrite the example that was lost, and to try it out in pure CFScript.
- Use feed to Read a WordPress blog feed and return a Query object. If this fails, create an empty query object.
- Execute an SQL Query to get recent News Stories from a MySQL database. If this fails, create an empty query object.
- Use Query of Queries to create a Union of the two sources previously defined. If this fails, create an empty query object.
- Setup Structs to defined properties for RSS Feed Creation
- Create the RSS Feed. This one gave me a bit of grief. I didn’t see my output file until I added ExpandPath to it. It took be a bit to figure out that to get assign the results of the create method to the xmlVar. Adobe’s documentation is sketchy on this – no working example. After reading through the documentation a few times, I eventually figured it out.