[XB] Amazon/eBay Parser

[XB] Amazon/eBay Parser 2.2.0 Release Candidate 1

No permission to download
I think it’s Amazon redirecting by IP maybe, if the same item is in stock on both .com and .co.uk. I’m getting the same thing if I click on our US affiliate links - it takes me to .co.uk. But if someone from the US clicks on them it takes them to .com. It’s annoying though.
 
I'm getting the following warning from the Amazon Parser add-on when an RSS feed is rendered:

Error:
Undefined array key "host"

Code:
#0 src/addons/Snog/Amazon/XF/BbCode/Renderer/Html.php(183): XF::handlePhpError(2, '[E_WARNING] Und...', '/www/wwwroot/te...', 183)
#1 src/addons/Snog/Amazon/XF/BbCode/Renderer/Html.php(35): Snog\Amazon\XF\BbCode\Renderer\Html->addAffiliateToHref('
    

    <div class...', Array, NULL)
#2 src/addons/SV/ReportImprovements/XF/BbCode/Renderer/Html.php(19): Snog\Amazon\XF\BbCode\Renderer\Html->renderTagUrl(Array, Array, Array, Array)
#3 src/XF/BbCode/Renderer/Html.php(357): SV\ReportImprovements\XF\BbCode\Renderer\Html->renderTagUrl(Array, Array, Array, Array, Object(SV\ReportImprovements\XF\BbCode\Renderer\Html))
#4 src/addons/s9e/MediaSites/XF/BbCode/Renderer/Html.php(17): XF\BbCode\Renderer\Html->renderTag(Array, Array)
#5 src/XF/BbCode/Traverser.php(63): s9e\MediaSites\XF\BbCode\Renderer\Html->renderTag(Array, Array)
#6 src/XF/BbCode/Traverser.php(39): XF\BbCode\Traverser->renderSubTree(Array, Array)
#7 src/XF/BbCode/Traverser.php(22): XF\BbCode\Traverser->renderAst(Array, Object(SV\SignupAbuseBlocking\XF\BbCode\RuleSet), Array)
#8 src/XF/Pub/View/FeedHelper.php(135): XF\BbCode\Traverser->render('Philips'in 5000...', Object(XF\BbCode\Parser), Object(SV\SignupAbuseBlocking\XF\BbCode\RuleSet), Array)
#9 src/XF/Pub/View/Forum/Rss.php(72): XF\Pub\View\FeedHelper::setupEntryForThread(Object(Laminas\Feed\Writer\Entry), Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#10 src/XF/Pub/View/Forum/Rss.php(31): XF\Pub\View\Forum\Rss->createEntry(Object(Laminas\Feed\Writer\Feed), Object(SV\SearchImprovements\XF\Entity\ThreadCollab), 'last_post_date')
#11 src/addons/DigitalPoint/Analytics/XF/Pub/View/Forum/Rss.php(28): XF\Pub\View\Forum\Rss->renderRss()
#12 src/XF/Mvc/Renderer/AbstractRenderer.php(92): DigitalPoint\Analytics\XF\Pub\View\Forum\Rss->renderRss()
#13 src/XF/Mvc/Renderer/Xml.php(72): XF\Mvc\Renderer\AbstractRenderer->renderViewObject('XF:Forum\\Rss', '', Array)
#14 src/XF/Mvc/Dispatcher.php(473): XF\Mvc\Renderer\Xml->renderView('XF:Forum\\Rss', '', Array)
#15 src/XF/Mvc/Dispatcher.php(455): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Rss), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(414): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Rss), Object(XF\Mvc\Reply\View))
#17 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'rss')
#18 src/XF/App.php(2830): XF\Mvc\Dispatcher->run()
#19 src/XF.php(850): XF\App->run()
#20 index.php(23): XF::runApp('XF\\Pub\\App')
#21 {main}

Code:
array(4) {
  ["url"] => string(56) "/sosyal/bolum/elektrikli-kucuk-ev-aletleri.259/index.rss"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

It points to the addAffiliateToHref() method, specifically this check:
if ($options->snog_amazonexpandshort && in_array($hrefArray['host'], ['a.co', 'amzn.to', 'amzn.eu']))

Just before that, $hrefArray is populated using:
$hrefArray = parse_url($urlstructure[0]);
It looks like some URLs passed through the RSS renderer can result in parse_url() returning an array without a host key, which then triggers the warning. Would it make sense to check that host exists before accessing $hrefArray['host']? The issue occurred while rendering a forum RSS feed.
 
I need to have amazon.eu links converted to amazon.com.tr or amazon.link as amazon.eu links does not have the proper tag. I can provide 30 USD budget for this update.
 
Good luck to all of you using this addon. It's against Amazon's terms of service to monetise user generated links and if their attention is drawn to you, they will at the very least send you a warning and maybe cancel your account.
 
No issues here either, and we've been doing our own Amazon links ever since this add-on was developed. I've had a few notices over the years (including one earlier this year), but they were for missing domains. So they've seen the sites plenty of times.
 
Painbaker updated [XB] Amazon/eBay Parser with a new update entry:

2.2.0 Release Candidate 1

New Features:​

  • Added Amazon Ireland affiliate settings
  • Added separate Amazon and eBay Disclosure Positions to display notices before message text, before attachments, or after attachments
  • Added Style properties for disclosure font size and spacing
  • Added support for regional eBay domains in Hong Kong, Singapore, Belgium, and French Canada

[COLOR=rgb(147, 101...[/HEADING]​



Read the rest of this update entry...​

 
Just checking this still supports 2.2? Your xenbaker site says 2.3 :s
it has only been tested on 2.3.13

I'm getting the following warning from the Amazon Parser add-on when an RSS feed is rendered:

Error:
Undefined array key "host"

Code:
#0 src/addons/Snog/Amazon/XF/BbCode/Renderer/Html.php(183): XF::handlePhpError(2, '[E_WARNING] Und...', '/www/wwwroot/te...', 183)
#1 src/addons/Snog/Amazon/XF/BbCode/Renderer/Html.php(35): Snog\Amazon\XF\BbCode\Renderer\Html->addAffiliateToHref('
   

    <div class...', Array, NULL)
#2 src/addons/SV/ReportImprovements/XF/BbCode/Renderer/Html.php(19): Snog\Amazon\XF\BbCode\Renderer\Html->renderTagUrl(Array, Array, Array, Array)
#3 src/XF/BbCode/Renderer/Html.php(357): SV\ReportImprovements\XF\BbCode\Renderer\Html->renderTagUrl(Array, Array, Array, Array, Object(SV\ReportImprovements\XF\BbCode\Renderer\Html))
#4 src/addons/s9e/MediaSites/XF/BbCode/Renderer/Html.php(17): XF\BbCode\Renderer\Html->renderTag(Array, Array)
#5 src/XF/BbCode/Traverser.php(63): s9e\MediaSites\XF\BbCode\Renderer\Html->renderTag(Array, Array)
#6 src/XF/BbCode/Traverser.php(39): XF\BbCode\Traverser->renderSubTree(Array, Array)
#7 src/XF/BbCode/Traverser.php(22): XF\BbCode\Traverser->renderAst(Array, Object(SV\SignupAbuseBlocking\XF\BbCode\RuleSet), Array)
#8 src/XF/Pub/View/FeedHelper.php(135): XF\BbCode\Traverser->render('Philips'in 5000...', Object(XF\BbCode\Parser), Object(SV\SignupAbuseBlocking\XF\BbCode\RuleSet), Array)
#9 src/XF/Pub/View/Forum/Rss.php(72): XF\Pub\View\FeedHelper::setupEntryForThread(Object(Laminas\Feed\Writer\Entry), Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#10 src/XF/Pub/View/Forum/Rss.php(31): XF\Pub\View\Forum\Rss->createEntry(Object(Laminas\Feed\Writer\Feed), Object(SV\SearchImprovements\XF\Entity\ThreadCollab), 'last_post_date')
#11 src/addons/DigitalPoint/Analytics/XF/Pub/View/Forum/Rss.php(28): XF\Pub\View\Forum\Rss->renderRss()
#12 src/XF/Mvc/Renderer/AbstractRenderer.php(92): DigitalPoint\Analytics\XF\Pub\View\Forum\Rss->renderRss()
#13 src/XF/Mvc/Renderer/Xml.php(72): XF\Mvc\Renderer\AbstractRenderer->renderViewObject('XF:Forum\\Rss', '', Array)
#14 src/XF/Mvc/Dispatcher.php(473): XF\Mvc\Renderer\Xml->renderView('XF:Forum\\Rss', '', Array)
#15 src/XF/Mvc/Dispatcher.php(455): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Rss), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(414): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Rss), Object(XF\Mvc\Reply\View))
#17 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'rss')
#18 src/XF/App.php(2830): XF\Mvc\Dispatcher->run()
#19 src/XF.php(850): XF\App->run()
#20 index.php(23): XF::runApp('XF\\Pub\\App')
#21 {main}

Code:
array(4) {
  ["url"] => string(56) "/sosyal/bolum/elektrikli-kucuk-ev-aletleri.259/index.rss"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

It points to the addAffiliateToHref() method, specifically this check:
if ($options->snog_amazonexpandshort && in_array($hrefArray['host'], ['a.co', 'amzn.to', 'amzn.eu']))

Just before that, $hrefArray is populated using:
$hrefArray = parse_url($urlstructure[0]);
It looks like some URLs passed through the RSS renderer can result in parse_url() returning an array without a host key, which then triggers the warning. Would it make sense to check that host exists before accessing $hrefArray['host']? The issue occurred while rendering a forum RSS feed.
Fixed in last update

I need to have amazon.eu links converted to amazon.com.tr or amazon.link as amazon.eu links does not have the proper tag. I can provide 30 USD budget for this update.
Should work in the latest update
 
Back
Top Bottom