You are here:  » Highlighting feeds not recently imported

Support Forum



Highlighting feeds not recently imported

Submitted by Paul1107 on Fri, 2010-10-22 07:16 in

Hi David

Hope all is good with you?

Wondered whether there anything that can be done about feeds not being picked up by the fetch script?

Not a major problem, but happens occasionally, not necessarily with same feed or merchant.

Its happened again today with 2 feeds that haven't imported and show 0 products, no doubt it will be rectified when the fetch script runs again, but I sometimes spot it and sometimes don't, the only reason I did this time is because products from these particular feeds are used in the home page of one of the sites.

Something else You can perhaps help with and something that can be built into the new upgrade (v.excited about that!) is a highlight of feeds that haven't been imported for say a week? this is something you helped with on one of my previous V1 installs but was lost on V2 installs.

Regards

Paul

Submitted by support on Fri, 2010-10-22 08:28

Hello Paul,

One method to prevent transient feed errors from wiping out their products from the database is to check for a minimum file size before importing. To do this, in includes/admin.php look for the following line of code just after the global statements at the top of the admin_import() function:

    global $admin_importCallback;

(line 368 in the distribution)

...and REPLACE that with:

    if (filesize($config_feedDirectory.$admin_importFeed["filename"]) < 2048) return;
    global $admin_importCallback;

This will check that a feed is at least 2K before importing. That value (2048 bytes in the above code) might need to be tweaked if working with very small CSV feeds, but should be fine under most circumstances.

To highlight feeds not imported for 1 week, look for the following code at line 199 in admin/index.php:

      print "<td>".($feed["imported"] ? rfctime($feed["imported"]) : "&nbsp;")."</td>";

...and REPLACE with:

      if (!$baseline) $baseline = strtotime("-1 week");
      if ($feed["imported"] && ($feed["imported"] < $baseline))
      {
        print "<td><strong>".rfctime($feed["imported"])."</strong></td>";
      }
      else
      {
        print "<td>".($feed["imported"] ? rfctime($feed["imported"]) : "&nbsp;")."</td>";
      }

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Paul1107 on Fri, 2010-10-22 13:25

Hi David,

Thanks for that, I think the first bit is OK - don't know how you can test, but nothing looks out of the ordinary? though in part 2 for the admin/index.php, after I pasted the mod as per the instructions, it renders the PT admin page blank?

Any advice?

Regards

Paul

Submitted by support on Fri, 2010-10-22 13:56

Hi Paul,

Sorry about that - there was a typo in the replacement - corrected above..!

Cheers,
David.
--
PriceTapestry.com

Submitted by Paul1107 on Fri, 2010-10-22 14:51

Thanks David,

That seems to have done the trick!

Any release dates for the new version yet?

Cheers

Paul

Submitted by support on Fri, 2010-10-22 15:00

I've been concentrating on the Wordpress plugin for the last couple of weeks as there are a number of users patiently awaiting it - and I will be inviting beta testers on Monday as soon as i've completed installation

Cheers,
David.
--
PriceTapestry.com

Submitted by Paul1107 on Fri, 2010-10-22 15:31

Cool!

How does that differ from the pt/wp installation that I run on my sites?

Cheers

Paul

Submitted by support on Fri, 2010-10-22 15:38

The main benefit will be search engine friendly product pages - that was always the problem with the external scripts within Wordpress. On most of your sites you actually link direct to merchant from your featured product sections so the actual appearance won't be significantly (if at all) different - it's just the implementation that will be much easier.

Cheers,
David.
--
PriceTapestry.com

Submitted by huntz on Fri, 2010-10-22 20:06

Wow really looking forward to the wordpress plugin, I've been trying to implement something similar myself for ages :-)

Submitted by Paul1107 on Fri, 2010-10-29 17:18

Hi David,

Sorry to come back on this, but it seems that I still having trouble with feeds not importing sporadically despite making the changes above, unfortunately I've no way of testing it.

Have you any suggestions

Regards

Paul

Submitted by support on Sat, 2010-10-30 08:13

Hi Paul,

As soon as you spot it having happened again, could you drop me an email with the site URL and feed filename that hasn't imported and I'll download it from your feeds folder to my test server and check it out... it may be a transient error for example, so whilst the feed looks a valid size the content is corrupt for some reason...

Cheers,
David.
--
PriceTapestry.com

Submitted by Paul1107 on Tue, 2010-11-16 12:33

Hi David,

Sorry to pester again, but as per this thread, you asked me to keep you updated if the feeds drop out again, well just noticed that I've had about 4-5 drop out to day, so is showing no products?

Cheers

Paul

Submitted by support on Tue, 2010-11-16 12:57

Hi Paul,

No problem - could you email me the filenames of the feeds and i'll take a look at them in your /feeds/ folder, and then look at what rules can be put in place to make sure that they don't overwrite the last good import...

Cheers,
David.
--
PriceTapestry.com