i'm trying to map to the following feed:
http://feeds.feedburner.com/TheCarpetbaggerReport?format=xml
within it, each item contains a description element, with an encoded content below it something like the following:
<content:encoded><![CDATA[<p>Today’s installment of campaign-related news items that wouldn’t generate a post of their own, but may be of interest to political observers:</p>
<p>* Maybe <a href="http://www.huffingtonpost.com/2008/03/24/clinton-undecided-on-apri_n_93125.html">we’ll get lucky</a>? “Democratic Sen. Hillary Rodham Clinton, once so eager to debate she ran two ads questioning why her rival wouldn’t, has yet to say whether she’ll debate Sen. Barack Obama in North Carolina next month. Both presidential candidates plan to participate in an ABC News debate on April 16 in Philadelphia. Pennsylvania holds it primary days later, on April 22. Obama also has agreed to a debate April 19 hosted by CBS in North Carolina. North Carolina holds its primary May 6. Clinton spokesman Howard Wolfson said Monday that the campaign has not made a decision about the CBS debate and is still working through the details.”</p>
<p>* James Carville, who compared Bill Richardson to Judas on Friday for endorsing Obama, <a href="http://thecaucus.blogs.nytimes.com/2008/03/24/carville-stands-by-judas-remark/">bragged yesterday</a> about how pleased he is with the comparison. “I was quoted accurately and in context, and I was glad to give the quote and I was glad I gave it,” Carville said. “I’m not apologizing, I’m not resigning, I’m not doing anything.” After a Clinton campaign spokesperson suggested Carville might want to apologize, the NYT called him back: “For several seconds he laughed – cackled might be more accurate – and then said he stood by his quote fully.”</p>
<p>* In what was billed as a major speech on his economic ideas, John McCain said he <a href="http://news.yahoo.com/s/ap/20080325/ap_on_el_pr/mccain_economy;_ylt=AukJLkOs_OOKtX4Ni1YwGWGs0NUE">doesn’t want to do anything</a> about the housing crisis: “Republican John McCain, who has conceded economics is not his strong suit, says government isn’t in the business of saving and rewarding banks or small borrowers who behave irresponsibly.”</p>
<p>* Top Clinton aide Harold Ickes is still <a href="http://tpmelectioncentral.talkingpointsmemo.com/2008/03/ickes_pledged_delegates_not_re.php">talking openly</a> about the options available for pledged delegates.</p>
<p>* Pennsylvania is leaning towards Clinton, and Oregon is leaning towards Obama, but no one knows what’s going to happen <a href="http://www.washingtonpost.com/wp-dyn/content/story/2008/03/24/ST2008032402418.html">in Indiana</a>.</p>
<p>* Gordon Fischer, a former chair of the Iowa Democratic Party and Obama supporter, wrote an <a href="http://politicalticker.blogs.cnn.com/2008/03/24/obama-supporters-blue-dress-blasted-by-clinton-campaign/">intemperate item</a> on his blog yesterday about a certain former president: “Bill Clinton cannot possibly seriously believe Obama is not a patriot, and cannot possibly be said to be helping — instead he is hurting — his own party. B. Clinton should never be forgiven. Period. This is a stain on his legacy, much worse, much deeper, than the one on Monica’s blue dress.” The Clinton campaign expressed outrage, accusing the Obama campaign of “gutter tactics,” though there’s no reason to believe the Obama campaign was involved with the blog post. Fisher later removed the item and apologized.</p>
<p>* All three of the remaining presidential candidates have been missing a lot of votes in the Senate, but McCain <a href="http://thecaucus.blogs.nytimes.com/2008/03/25/on-the-road-again/">barely seems to show up</a> for his day job at all.</p>
<p>* No matter who wins Pennsylvania’s primary, Dems have to be happy about <a href="http://tpmelectioncentral.talkingpointsmemo.com/2008/03/dem_registration_hits_new_reco.php">this</a>: “Democratic registration in Pennsylvania set a new record yesterday, at the close of yesterday’s deadline to register for the state’s closed primary. Over 4 million Pennsylvanians are now registered as Democrats, out of 8.2 million total registered voters. Republican and independent registrations both shrank slightly — a possible sign of crossover voters for Barack Obama — while 120,000 previously unregistered people entered the rolls.”</p>
<p>* Facing a looming deadline, Republicans in New Jersey <a href="http://www.northjersey.com/news/Unanue_declares_run_for_US_Senate.html">finally found a candidate</a> to run against Sen. Frank Lautenberg (D) in November: Andrew Unanue, a former executive with Goya Foods Inc. Unanue “was ousted from the leadership of Goya Foods in a family feud in 2004 and has since run a financial consulting firm and a New York nightclub.”</p>
<p>* And in Virginia, Lt. Gov. William Bolling (R) announced yesterday he <a href="http://www.washingtontimes.com/apps/pbcs.dll/article?AID=/20080325/METRO/247722391/1001">will not run</a> for governor, clearing the way for state Attorney General Robert McDonnell, and giving the state GOP its first good chance of winning the governorship in a decade.</p>
<p class="akst_link"><a href="http://www.thecarpetbaggerreport.com/?p=15006&akst_action=share-this" title="E-mail this, post to del.icio.us, etc." id="akst_link_15006" class="akst_share_link" rel="nofollow">Share This</a>
</p>
<p><a href="http://feeds.feedburner.com/~a/TheCarpetbaggerReport?a=CvPts8"><img src="http://feeds.feedburner.com/~a/TheCarpetbaggerReport?i=CvPts8" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?a=8wren6F"><img src="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?i=8wren6F" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?a=7iN1AKF"><img src="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?i=7iN1AKF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?a=gy1nMjf"><img src="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?i=gy1nMjf" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?a=eIx1TUf"><img src="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?i=eIx1TUf" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?a=EScf2IF"><img src="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?i=EScf2IF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?a=CGyFrGF"><img src="http://feeds.feedburner.com/~f/TheCarpetbaggerReport?i=CGyFrGF" border="0"></img></a>
</div>]]></content:encoded>
How can I map to that element? I don't see it on the map tab.
Thanks,
aaron
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | description_fetch_from_feed_object.png | 23.75 KB | aron novak |
Comments
Comment #1
alex_b commentedHi Aaron,
for getting to the stuff that's encoded in the CDATA element, you would have to use a little bit of extra trickery. You might be able to pull this data out by a secondary parsing step after the first one. There is an unused feature in FeedAPI that allows you to define secondary parsers that can do custom parsing on feeds after the first parser went over it. I have never used it, Aron Novak is the expert on this - I will point him to this thread and ask him for advice.
Alex
Comment #2
aron novakYes, Alex is right. You need to write a secondary processor.
The concept of the secondary processor is the following:
Primary processor is responsible for normal feed item properties, such as description and title.
Secondary parsers can return additional thing, that will be merged into ->options.
Here is how:
So you need to write a parser. Your parser will a pre-filled $feed object if it's a secondary parser. Let's see the attached image.
You need to fetch the relevant information, fill the $feed->items[N]->options->detailed_desc property for example and pass back the feed.
On how to write a parser, there is a guide: http://groups.drupal.org/node/5301
If you need further help, please feel free to ask.
Comment #3
Krummrey commentedHave you tried using Yahoo Pipes?
With Yahoo Pipes you can rearrange many input formats, including XML, into a RSS Format.
I've succesfully mapped many fields from such an RSS feed into taxonomies.
Issue still active?
Comment #4
cglusky commentedThanks Aron for the info in #2 - I am messing with parsing Common Alerting Protocol (CAP) feeds from the USGS, Weather Service and a few others. I am working in D6 and have more questions for you and the community about the issue of secondary parsers to solve this issue. I created my own primary parser it seems and may not have had to. I do not want to hijack this issue but it is very closely related. Where would the best place be to continue this conversation? This seems to be a bit of a FeedAPI issue with overlap to element mapper. I have a working parser for ATOM/CAP 1.1 feeds and would like to get it back in the community for further work.
Thanks!
Coby
Here is my test site pulling in some of the CAP feeds and using element mapper to cck and location:
http://ic.metanomy.org/
Comment #5
summit commentedSubscribing, greetings, Martijn
Comment #6
alex_b commentedOther options to access more elements of a feed:
#199360: Add namespace support to Parser Common Syndication adds extended namespace support to parser_common_syndication
http://drupal.org/project/feedapi_eparser - is an extensible parser that allows you to write plugins for feeds
I reiterate: this problem is not related to Feed Element Mapper, it's the parser's responsibility to parser and expose feed elements to the rest of the aggregation stack. However, this is such a common request that I'd like to keep this issue open on the Feed Element Mapper issue queue.