Sunday, 29 July 2018

Filter Zazzle rss feeds with this new Nifty tool

EDIT: Major re-write planned - see next post 

In English: You can now exclude product designs from Zazzle feeds using filter terms.

In brief: I've stripped out the scheduler parts from the nIFTTTy Scheduler tool to make a filtered version of any Zazzle feed.

Summary: I've created a filterable version of Zazzle's rss feed mechanism (it's basically the nIFTTTy scheduler with the scheduling part stripped out). The feed it produces is identical in every respect to Zazzle's EXCEPT that it produces a valid Atom feed. This is for maximum interoperability.

You see, feeds produced by Zazzle don't validate and that can cause issues with some online services.

Feel free to play with it as per the below but note that I've limited the number of items it produces to a maximum of 10. This is so that peeps don't start using it for real!

Perfect for when Zazzle fixes pulling from the market place!

Because of a bug with Zazzle's feed mechanism when pulling from the marketplace, just like Zazzle, this new Nifty tool won't work properly.

So right now this new tool is little more than a novelty. That's because the filter feature only really comes into its own when pulling from the market place - you know, to remove create your own results, things like that.

But there might be other ways you can think of using it where pulling from the market place isn't needed. If that's you, you can get a licensed copy of the php code to put on your own server - just get in touch using highton.ridley @ g mail .com

Description

Use is much like for a Zazzle feed request with these additions:

  • Set the store or the collection id using the additional parameter &storeid= like this:
    •  &storeid=hightonridley or &storeid=collections/119287424146492479
  • Another additional parameter: 
    • &uprn=1 means the Zazzle-supplied product name will appear in the product title
    • &uprn=0 means it won't.
  • The new filter parameters - they filter out, ie remove, matching product designs:
    • &trm1=trump
      Note that these terms (trm1, 2 & 3) can use either a word or phrase; use + to separate words in a phrase, like this:
      • &trm1=santa+claus
    • &trm2=
    • &trm3=
    • &lttls=
      • eg lttls=1 means look in titles when filtering
      • ltts=0 (or leaving it blank or leaving it out altogether) means don't look in titles
    • &ldscs= look in description - its use is as per lttls
    • &ltags= look in tags - its use is as per lttls


A full example

http://kdl.to/rss/nifty-zfrss-feed.php?storeid=hightonridley&qs=&st=popularity&sd=desc&ps=8&pg=1&dp=&cg=&at=238582202591969585&tc=my_tracking_code&trm1=phoenix&trm2=lawyer&trm3=red&lttls=1&ldscs=&ltags=&uprn=1


Go on, copy that and paste it into the address bar of a new browser tab. Firefox will show the feed output as intended for humans to read.

If you take out the filter term lawyer, you'll see some lawyer designs appear. Same for taking out the filter term red.


Nifty filtered feed output in Firefox
Click the image to see the feed in your browser

Chrome will display the feed's source as almost-unreadable XML.

See the available data for each item in a friendly display by visiting https://codebeautify.org/xmlviewer
and then hit the Load Url button and paste in:
http://kdl.to/rss/nifty-zfrss-feed.php?storeid=hightonridley&st=popularity&sd=desc&ps=8&pg=1&at=238582202591969585&trm1=phoenix&lttls=1&trm2=lawyer

⚠️ That viewer breaks if you include any parameters that don't have values, that's why I've taken any like that out of the url
----------------------------------
🤓 Note that this feed mechanism uses YQL, an online service provided by Yahoo for retrieving feeds and standardising them. It's been around for years and is expected to be around for many more to come.

Even so, I'm going to work on a version that does away with using YQL, if there's enough interest.

No comments:

Post a Comment

Comment moderation is switched on. Please wait till I've had a chance to review your comment and publish it. Thanks!