3

When you import RSS items via Feeds, where are the URL and GUID target values stored in the node? How do you get these out? I am not seeing anything close to these when I dump the $node.

This shows the Mappings screen with the values that I am talking about:

enter image description here

3 Answers 3

6

They are stored in the feeds_item table in the database. They are used by the feeds module to control updates of imported items.

4
  • If you need the link in a template, is the only way to get it is by adding an additional mapping onto a field in the content type, or is this somewhere in the $node already?
    – mpdonadio
    Commented May 3, 2012 at 0:11
  • I don't think they're in the $node and I would use extra mappings. If your familiar with the devel module (more importantly if your not!) you can download and enable [devel] (drupal.org/project/devel) and use the kpr function to view the node object. Devel is a great tool for developers.
    – paradrupal
    Commented May 3, 2012 at 14:30
  • Thanks. The question started because I wasn't seeing the info when I did a kpr($node), and was rather surprised that it wasn't there. There are 100 ways to tackle this, but I don't want to reinvent the wheel or duplicate the data if it was somewhere that I wasn't seeing.
    – mpdonadio
    Commented May 3, 2012 at 14:43
  • 1
    No, I think duplicate mappings if you need them. Beware, feeds also checks a hash of the import to check for updates (see FeedsProcessor.inc) I'm not sure what your using this for, but if your looking at what version gets updated when you'll need hash data from that table as well.
    – paradrupal
    Commented May 3, 2012 at 18:08
2

Use feeds_item_info_load() to get the feed item object, eg:

$fii = feeds_item_info_load('node', $node->nid);
0

I had the same problem .. I use a db_query to retrieve the source

if you need to load information from feed_items then use feeds_item_info_load. However I need to load the source URL, and so far I havent found anything to do that. With the dbase query below you can retrieve the source feed.

$key = 'www.somefeed.com';
$result = db_query('SELECT feed_nid from feeds_source where source = :source', array(':source'=>$key ));

foreach ($result as $record) {
    $feed_nid[] = $record;
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.