1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Amazon Parser 3.0

Adds Amazon affiliate ID to links in messages.

  1. AndyB

    AndyB Well-Known Member

    AndyB submitted a new resource:

    Amazon Parser - Adds your Amazon Affiliate ID to URLs contained in messages.

    Read more about this resource...
    upnet, Andy.N and giorgino like this.
  2. LurkerLou

    LurkerLou Active Member

    If this works this will be a great add-on.
  3. giorgino

    giorgino Well-Known Member

    @AndyB please please add .it affiliate ID! :love::love::love:
    Adam Howard likes this.
  4. AndyB

    AndyB Well-Known Member

    Adam Howard likes this.
  5. WhoIsDo

    WhoIsDo Active Member

  6. dvsDave

    dvsDave Well-Known Member

    A thousand Thank You's!! This has been one of the few sore spots of moving to xenForo from vB.
  7. Andy.N

    Andy.N Well-Known Member

    Thanks for the addon. This is something I have been looking forward to to replace the current URLrewriter addon that has not been updated for ages.
    After installing it, add my .com affiliate ID, and go back to on my previous threads that have amazon links, it does not seem to work.
    1) it only seems to work on new posts.
    2) If I add http://www.amazon.com/gp/product/0979757622 to the post, it will chance to http://www.amazon.com/gp/product/0979757622/?tag=affiliate-ID.

    I think it would be better if the affiliate id is hidden using [url=http://www.amazon.com/gp/product/0979757622/?tag=affiliate-ID]http://www.amazon.com/gp/product/0979757622[/url]
    3) Also, turning on the Link Proxy will not result in any link clicking being logged.
  8. dvsDave

    dvsDave Well-Known Member

    Oh man, I thought this would re-parse on the fly. Shoot. Can I run a command to have it go through all the existing amazon links?
  9. AndyB

    AndyB Well-Known Member

    I've already written the Amazon Parser All add-on which will be used to update all posts. Currently it's being tested and I hope to release it in a day or two.
    dvsDave likes this.
  10. Adam Howard

    Adam Howard Well-Known Member

    Error Info
    ErrorExceptionFatal ErrorCannot redeclare amazon_links() (previously declared in /home/www/public_html/forums/library/Andy/AmazonParser/DataWriter/DiscussionMessage/Post.php:14) - library/Andy/AmazonParser/DataWriter/DiscussionMessage/Post.php:14
    Generated By
    AdamA moment ago
    Stack Trace
    #0 [internal function]: XenForo_Application::handleFatalError()
    #1 {main}
    Request State

    array(3) {
    "url"] => string(81"http://www.sociallyuncensored.eu/forums/threads/link-test-preview.18449/add-reply"
    ["_GET"] => array(0) {
    "_POST"] => array(10) {
    "message_html"] => string(26"<p>anonymous reply<br></p>"
    ["_xfRelativeResolver"] => string(72"http://www.sociallyuncensored.eu/forums/threads/link-test-preview.18449/"
    ["anonymous_posting"] => string(32"aed4338e8fbbf65c27e32c1deddf0727"
    ["attachment_hash"] => string(32"db094178bb77ab9392ae6d14252f3497"
    ["last_date"] => string(10"1393365090"
    ["last_known_date"] => string(10"1393365090"
    ["_xfToken"] => string(8"********"
    ["_xfRequestUri"] => string(40"/forums/threads/link-test-preview.18449/"
    ["_xfNoRedirect"] => string(1"1"
    ["_xfResponseType"] => string(4"json"
    The error only seems to happen when you try to post "anonymously" using @xfrocks add-on and only on replies, not making a new thread.
  11. AndyB

    AndyB Well-Known Member

    Adam Howard likes this.
  12. rhs

    rhs Member

    If you write My Amazon Link the affiliate_id is hidden after save this post. If you write http://www.amazon.com/gp/product/0979757622 the affiliate_id is not hidden. That is like XF works ...
  13. Andy.N

    Andy.N Well-Known Member

    I've been using this addon http://xenforo.com/community/threads/urlrewriter-auto-media-embed-and-affiliate-schemes.8292/

    When you enter http://www.amazon.com/gp/product/0979757622 it will keep that format but when you click on it, it will go to http://www.amazon.com/gp/product/0979757622/?tag=id
  14. Adam Howard

    Adam Howard Well-Known Member

    AndyB likes this.
  15. rhs

    rhs Member

  16. AndyB

    AndyB Well-Known Member

  17. Daniel Hood

    Daniel Hood Well-Known Member

    I'm a little curious as to why you're doing it through datawriter instead of on the fly also. I would recommend applying the same concept through XenForo_BbCode_Formatter_Base instead of the datawriter. This would not only allow you to change the affiliate id at any point without updating every post but also allow it to apply to other content types instead of just posts.

    [Edit] matter of fact, I think the perfect place to implement this code would be through: XenForo_BbCode_Formatter_Base::renderTagUrl(). I think it would improve this add on greatly if you switched to this method. You also don't run the risk of corrupting old messages. And your add on can be disabled at any point and the old links reverted back to how they were.

    Just something for you to consider.
  18. Qwest

    Qwest Member


    Glad I read your post. I was just coming here to ask if this was done at render. Any other way makes no sense.
  19. Qwest

    Qwest Member


    Just wondering if you're working to get it to work at render.
  20. MotMann

    MotMann Active Member

    Last edited: Mar 17, 2014

Share This Page