• Resolved ioanas

    (@ioanas)


    Hello!

    I’m using WP RSS Aggregator to fetch data for multiple sources and then custom integrate all that data into a page.

    For this customisation, I need to know when all those feeds have finished fetching, and have done so successfully.

    Is there a way to check the status for single / multiple feed(s) fetch import?

    Thank you!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Fetching of feeds is a regularly scheduled process. The end time for a feed fetch depends on the number of new feed items available, the size of the content and the connectivity speeds involved.

    Feeds also regularly provide new content, and the update interval you set will determine how often the new content is fetched.

    To check the status of imports, you can visit RSS Aggregator > Feed Sources in your dashboard. The last updated time, next update time , number of new items to be fetched, and the number of items already fetched are highlighted there.

    I’d suggest going ahead with integrating the imported data anyway. Each time new content is available in the feeds, the page will be updated with new content.

    Closing this thread since it is duplicate.

    EDIT: This thread was closed in error, so have re-opened it. Apologies for that.

    • This reply was modified 5 years, 1 month ago by Naweed Chougle. Reason: Apologies, this was closed in error
    Thread Starter ioanas

    (@ioanas)

    Thank you for your feedback!

    As part of integrating the feeds data, I need to automatically check when the feeds have successfully finished importing and then continue the integration.

    Checking this on RSS Aggregator > Feed Sources is good for a manual approach, but I need to make this programmatically, from a function in WP theme’s function.php file.

    More exactly, I need to bind one of my functions to WP RSS Aggregator importing functionality and when the feeds have successfully finished importing, then create a new page. I already have done this part, creating a new page, but I need to bind it to WP RSS feeds successfully importing data, either by manually fetch or by scheduled fetch.

    To what WP RSS Aggregator action / filter can I hook on to achieve this?

    • This reply was modified 5 years, 1 month ago by ioanas.
    Naweed Chougle

    (@hypersonic)

    You can hook into the wprss_fetch_single_feed_hook action with a priority higher than 10. The action handler will receive the feed ID as argument.

    If you need to know whether anything was actually imported, you can check the wprss_last_update_items meta field for that feed to get the number of items that were imported.

    If you need to get the actual items, you can use wprss_get_feed_items_for_source() which returns a WP_Query object. Using the count that you get from meta, you can slice the post array.

    For example:

    add_action('wprss_fetch_single_feed_hook', function($feed_id) {
        $num_items_imported = get_post_meta($feed_id, 'wprss_last_update_items', true);
    
        $feed_items = wprss_get_feed_items_for_source($feed_id)->get_posts();
        $feed_items = array_slice($feed_items, 0, $num_items_imported);    
    }, 11);
    Thread Starter ioanas

    (@ioanas)

    Thank you for your feedback, it’s very helpful!
    For the moment, is exactly what I needed.

    An extra question, do you have any idea why this is happening?
    In WP Admin -> RSS Aggregator -> Tools -> Logs tab -> Debug tab, I get messages like “Item X already exists in the database”, then it’s skipped from importing, on the scheduled fetching.
    But in WP Admin -> RSS Aggregator -> Feed Items, I don’t see that item, I can’t find it in database ( either by WP Query, either by manually querying the posts / postmeta tables ).
    And this is happening for all the scheduled fetching, not to the manual fetching.

    Naweed Chougle

    (@hypersonic)

    You’re very welcome.

    Did you check for the presence of previously imported items even in the Trash section?

    Our plugin will skip importing feeds if it detects that the items are present anywhere in the database, including the Trash of all posts and custom post types. This measures prevents duplicate content from appearing on your site.

    Thread Starter ioanas

    (@ioanas)

    I’ve checked for the presence of previously imported items. There are none in the Trash section.

    While following this idea, that items might be in Trash, I noticed that the scheduled fetching acts as if there are already imported items when the day changes.
    I’m importing feeds on a daily basis, currently set once at every 2 hours. After the 1st import for today, I’m OK with the plugin skipping the items.

    However, tomorrow morning, when the scheduled fetch is running and the feed source has new content, the items are seen as already imported and the fetch skips them, although there are no items imported for today.
    What the plugin detects as existing items and lists in WP Admin -> RSS Aggregator -> Feed Items, and what I can query on the database, are the imported items for the previous day.

    I’ve set the feeds to a limit 4 times greater than the actual number of items I need to be stored for each feed, but it seems this has nothing to do with this behaviour for the scheduled fetching.

    Also, with yesterday’s items imported, the manual fetch also does not import items for today.

    How can I overcome this issue for fetching items for today, when there are imported ones for the previous day(s)?
    I’m insisting on this because it’s one of the last steps in the implementation I’m working on.

    Naweed Chougle

    (@hypersonic)

    What the plugin detects as existing items and lists in WP Admin -> RSS Aggregator -> Feed Items, and what I can query on the database, are the imported items for the previous day.

    That is how our plugin works currently. When the feed items are being imported, our plugin will check for the presence of the same previously imported items regardless of when they were imported. Are you looking to customize this default behavior?

    Thread Starter ioanas

    (@ioanas)

    Oh, I see.
    As a clarification on how I understand the plugin’s settings and their effect, the limit placed on WP Admin -> RSS Aggregator -> Settings -> Limit feed items stored per feed, respectively on each feed source, when it takes effect, if this is how the plugin currently works?
    I thought that this limit is used to keep only the latest X imported items for each feed. By setting this limit, I could store feeds items for the last, let’s say, 4 days.

    Considering that this is how the plugin works and that you mentioned customisation of this default behaviour, I’d really like to be able to tell apart the imported items per day when fetching. How can I accomplish this, when the manual / scheduled fetch is running?

    Thread Starter ioanas

    (@ioanas)

    Thank you for your assistance regarding these inquiries!
    It has been helpful.

    Naweed Chougle

    (@hypersonic)

    You’re very welcome, @ioanas!

    Glad to know my replies were helpful. It will be wonderful if you could rate and review our plugin.

    • This reply was modified 5 years ago by Jan Dembowski. Reason: Removed link with ?filter=5 on it
    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @hypersonic Don’t put ?filter=5 in your review links, it hides the non-5 star reviews from the person who uses that link and that’s not being completely honest. That’s not necessary as the stars default to 5 for all new reviews. The reviewer would manually need to change it to something other than 5 if they wanted to.

    I’ve removed that part and now they’ll see the actual reviews and not just the 5 star ones.

    Naweed Chougle

    (@hypersonic)

    @jdembowski Thanks for the reminder. I’ll keep that in mind for future replies.

    @ioanas It seems from your review that you were unable to get the ‘Limit feed items by age’ option to work right. This setting is available both on the Edit Feed Source page in the Feed Processing box and globally at RSS Aggregator > Settings > General. Items already imported will be deleted when they exceed this feed limit. To know more, please hover your mouse on the little question mark next to this setting.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Check feed fetch status’ is closed to new replies.