Skip to content

Instantly share code, notes, and snippets.

@half-ogre
Created November 23, 2011 03:17
Show Gist options
  • Save half-ogre/1387798 to your computer and use it in GitHub Desktop.
Save half-ogre/1387798 to your computer and use it in GitHub Desktop.
var linksArray = DomUtils.getElementsByTagName("link", item.children, false);
var entryLink = linksArray[0].attribs.href;
for (var i = 0; i < linksArray.length; i++) {
var linkRel = linksArray[i].attribs.rel.toLowerCase();
if (linkRel === 'alternate') {
entryLink = linksArray[i].attribs.href;
break;
}
}
entry.link = entryLink;
@half-ogre
Copy link
Author

I find this a bit more readable, but I'll admit it's not that much different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment