When creating RSS feeds with the CFFEED tag, you can specify metadata properties for the feed that help describe the feed in general. The docs though aren't very clear on what metadata properties you can provide.
The docs say that for RSS 2.0 feeds the title, link, description, and version properties are required, but all others are optional. What others? I was never able to find documentation that describes what fields you can use. At the same time though CFFEED is smart enough to recognize valid fields. If you pass a field named "ray" for example, it ignores it when creating the feed. So what is available? I did some Googling and I found a specification for RSS 2:
The docs here listed a bunch of items all of which worked. In general they were all simple to use. For example, here was my initial metadata based on what I had to pass:
<!--- Struct to contain metadata --->
<cfset meta = structNew()>
<cfset meta.title = "Orange Whip Studio Films">
<cfset meta.link = "http://localhost/ows">
<cfset meta.description = "Latest Films">
Next I added additional fields:
<cfset meta.language = "Klingon">
<cfset meta.copyright = "I own you.">
<cfset meta.managingEditor = "ray@camdenfamily.com">
<cfset meta.webmaster = "ray@camdenfamily.com">
<cfset meta.pubDate = now()>
<cfset meta.lastBuildDate = now()>
This worked fine until I hit categories. Categories have been an array of a structs:
<cfset meta.category = []>
<cfset meta.category[1] = structNew()>
<cfset meta.category[1].value = "Boogers">
Why? Because categories support an optional domain field. To supply the domain just add it as a key:
<cfset meta.category = []>
<cfset meta.category[1] = structNew()>
<cfset meta.category[1].domain = "foo">
<cfset meta.category[1].value = "Boogers">
Another complex value is the cloud key. This takes 5 subkeys:
<cfset meta.cloud = structNew()>
<cfset meta.cloud.domain ="rpc.sys.com">
<cfset meta.cloud.port = "80">
<cfset meta.cloud.path = "/rpc2">
<cfset meta.cloud.registerProcedure="pingMe">
<cfset meta.cloud.protocol = "soap">
Lastly - both the skipdays and skiphours fields require special values - and these are actually documented. The skipdays value is a list of days and skiphours is a list of hours.
<cfset meta.skipHours = "0,1,2,3,4,5,6">
<cfset meta.skipDays = "Saturday,Sunday">
Another cool metadata field is image. When used, this provides a nice little logo when viewing the feed. (At least it did in Firefox.)
<cfset meta.image = structNew()>
<cfset meta.image.title = "Logo">
<cfset meta.image.url = "http://localhost/ows/images/logo_a.gif">
<cfset meta.image.link = meta.link>
One field in particular that was interesting was the textInput field. Form the specs:
A channel may optionally contain a <textInput> sub-element, which contains four required sub-elements.
Ok - that's cool - but then the next paragraph reads:
The purpose of the <textInput> element is something of a mystery. You can use it to specify a search engine box. Or to allow a reader to provide feedback. Most aggregators ignore it.
Sweet. I love it when specs say something is a mystery. Below is the complete set of metadata I tried, all of which worked (except textInput, it did show up in the xml, but Firefox didn't do anything with it). Tomorrow I'm going to do the same digging for Atom.
<!--- Struct to contain metadata --->
<cfset meta = structNew()>
<cfset meta.title = "Orange Whip Studio Films">
<cfset meta.link = "http://localhost/ows">
<cfset meta.description = "Latest Films">
<cfset meta.language = "Klingon">
<cfset meta.copyright = "I own you.">
<cfset meta.managingEditor = "ray@camdenfamily.com">
<cfset meta.webmaster = "ray@camdenfamily.com">
<cfset meta.pubDate = now()>
<cfset meta.lastBuildDate = now()>
<cfset meta.category = []>
<cfset meta.category[1] = structNew()>
<cfset meta.category[1].domain = "foo">
<cfset meta.category[1].value = "Boogers">
<cfset meta.generator = "ColdFusion 8, baby">
<cfset meta.docs = "http://cyber.law.harvard.edu/rss/rss.html">
<cfset meta.cloud = structNew()>
<cfset meta.cloud.domain ="rpc.sys.com">
<cfset meta.cloud.port = "80">
<cfset meta.cloud.path = "/rpc2">
<cfset meta.cloud.registerProcedure="pingMe">
<cfset meta.cloud.protocol = "soap">
<cfset meta.ttl = 60>
<cfset meta.image = structNew()>
<cfset meta.image.title = "Logo">
<cfset meta.image.url = "http://localhost/ows/images/logo_a.gif">
<cfset meta.image.link = meta.link>
<cfset meta.rating = "pics rating">
<cfset meta.textInput = structNew()>
<cfset meta.textInput.title = "Search">
<cfset meta.textInput.description = "Use this to search our site">
<cfset meta.textInput.name = "search">
<cfset meta.textInput.link = "http://localhost/ows/69/_temp.cfm">
<cfset meta.skipHours = "0,1,2,3,4,5,6">
<cfset meta.skipDays = "Saturday,Sunday">
<cfset meta.version = "rss_2.0">
Archived Comments
I don't think there are many aggregators that actually use the textInput element.
http://www.w3schools.com/rs...
Another good source for RSS element information is ..
http://www.w3schools.com/rs...
For Atom try ..
http://www.atomenabled.org/...
or for the official spec..
http://www.atomenabled.org/...
Ill try that again..
http://www.atomenabled.org/...
http://www.atomenabled.org/...
I don't think your comments like url's with dashes in them ..
/developers/syndication/atom-format-spec.php
How could you solve the following. My feeds are all compressed and the CFFEED tag cannot handle them :-( It would be (I think) a good addition to solve this within Coldfusion because you have the same problem with the CFHTTP tag whenever content is compressed.
Any suggestions??
You got me there. Seems like a good enhancement request though. http://www.adobe.com/go/wish
It's in the mail.. it would be really nice indeed if the boys and girls at Adobe would put that in.. Or if someone would come up with a Java solution.. anyone??
Hi Tjarko/Ray,
try this (a way around solution suggest bu Rupes of CF engineeering team) but as per Hemant (CF engineering manager) in the comments below this has already been logged & should be taken taken of
http://coldfused.blogspot.c...
I am trying to place meta data in a site. These are the remaining <cfset Meta???=" "> codes that I need to locate and place on the site. The rest I've figured out. If you guys/girls can enlighten me as to the correct cfset tags
to use so I can complete it, I would appreciate it.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
What I want to add is:
1) Language identification
2) reply-to
3) category
4) rating
5) robots index all
6) robots revisit after 14 days
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The HTML equivilant is:
1) <meta http-equiv="Content-Language" content="en">
2) <meta name="reply-to" content="info@autoadvisors.com">
3) <meta name="category" content="Business & Economy">
4) <meta name="rating" content="General">
5) <meta name="robots" content="all">
6) <meta name="revisit-after" content="14 days">
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If anyone has any other lines of code they would suggest placing for site optimization, please feel free to suggest.
Thanks in advance,
Um, this article is about metadata for RSS feeds. It has nothing to do with metadata tags for HTML pages.
My Apologies. Is there anyone that you could direct me to that would have the insight? It's actually for metadata for a Coldfusion site, my example is what I've found which is the html equivalent. I'm unfamiliar with the tags.
Again, thanks in advance, (and your patience)
You don't do anything special on a CF site to add HTML meta tags, or any tag. If you do <FOO>, CF will ignore it. CF only looks for it's own tags and functions.
Okay Ray, after about three day's of learning how to use the cffeed tag, I have managed to create a TwitterFeed and a feed.cfm and feed.xml file for my site. But, at this point I am utilizing all available items. One question a the moment revolves around category. Take a look:
<category>Link Building</category>
<category>Pay per Click (PPC)</category>
<category>AdWords</category>
<category>natural</category>
<category>natural-organic-placement</category>
<category>organic</category>
<category>organic-positions</category>
<category>pay-per-click</category>
<category>ppc</category>
The first two category xml outputs are for CATEGORYSCHEME and not for CATEGORYLABEL. The problem is getting the CATEGORYSCHEME to output, but not as a CATEGORYLABEL. Is that possible? At this point I can not create a solution when using the cffeed tag to create and output the http:www.linkworxseo.com/bl... from the feed.cfm file.
I'm afraid I don't quite understand you. I've reread your comment a few times and I just can't grok what you want. Can you rephrase it?
Notice the words Link Building and Pay per Click (PPC). These are actually categories and not tags. Anything after those two categories are tags but appear as a tag item which is a CATEGORYLABEL and not a CATEGORYSCHEME as the first two.
<cfset myStruct.item[currentRow].category.domain = xmlFormat(CATEGORYSCHEME) />
<cfset myStruct.item[currentRow].category.value = xmlFormat(rssFeed.CATEGORYLABEL) />
<cfset myStruct.item[currentRow].comments.value = xmlFormat(rssFeed.COMMENTS) />
Does that help?
Um, no, sorry, it doesn't. Are you trying to _add_ this to XML and it is failing? Is the link you sent me an example of it failing? Maybe it would help if you showed me the XML you would like to end up with? If I'm even reading you right.
Right, the .xml is failing to show as a CATEGORYSCHEME and being listed as CATEGORYLABEL instead. The first two items are actually categories and not tags.
Category:<categoryscheme>Link Building</categoryscheme>
Category:<categoryscheme>Pay per Click (PPC)</categoryscheme>
Tag:<category>AdWords</category>
Tag:<category>natural</category>
My Code:
Categories:<cfset myStruct.item[currentRow].category.domain = xmlFormat(CATEGORYSCHEME) />
Tags:<cfset myStruct.item[currentRow].category.value = xmlFormat(rssFeed.CATEGORYLABEL) />
Feed: www.linkworxseo.com/blog/fe... or replace .cfm with .xml
Not actually failing, just outputting the categories as tags. Sorta failing.
First blog post check the first two links on the first post.
www.linkworxseo.com/blog/
These are categories(Link Building and Pay per Click (PPC))while the rest here are tags (AdWords natural natural-organic-placement organic organic-positions pay-per-click ppc).
These are pulled in with a READ and then wanting to output it as CREATE properly formatted .xml items from a WordPress blog.
Just looked through your blog.cfc - impressive.
Ahhh I'm kinda getting you now. So question - are you trying to do this with CFFEED or just XML funcs? If you could create a script for me, one that is failing obviously, that I could run here, I could debug. (If you do, please post it as a Pastebin or Gist.)
Actually what I have figured out is this: I managed to pull the .xml as an NewArray() into a blog page that gets updated every time a new web blog post is created. This issue at hand was from the category or tag output on the page.
Example: The link to the category and tag will not changed according to the type of .xml category or tag.
myStruct.item[currentRow].category.domain = xmlFormat(CATEGORYSCHEME) Category on blog
myStruct.item[currentRow].category.value = xmlFormat(rssFeed.CATEGORYLABEL) Tag on blog
I figured out that the .xml for either one of these outputs is treated the same from what I can tell at this point. It seems the two are not separated and output as the same on the page. So this is a category but the link to this blog post is: /tag/social-media-marketing-smo/ but changes to /category/social-media-marketing-smo/ when it gets to the page.
Archive
Archive for the ‘SOCIAL MEDIA MARKETING (SMO)’ Category
This is what I have been trying to get around. Even thought it is providing a link with tag in it, it still redirects to the link with category in it. I am trying to make CATEGORYSCHEME output the first link with category instead of tag, that way a redirect is not needed when getting to the actual page. Where can I send you the examples you asked for?
Use Pastebin. Your code should be one file (if not, make it so) and not using a db or anything. I should be able to cut and paste and run.