SpikeHD / AmazonMonitor

Amazon price checker, item monitor and stock monitor, all shoved into a Discord bot
GNU General Public License v3.0
235 stars 39 forks source link

Is there a way to make the links it sends out clickable also editable? #14

Closed pr110 closed 4 years ago

pr110 commented 4 years ago

Is it possible to make the links clickable and also change the link that it spits out. Obviously the link imputed has to normal, but is there a way to have it spit out affiliate links, different from the imputed one?

SpikeHD commented 4 years ago

Links should already automatically be clickable I believe, can you screenshot a message that contains one that isn't?

As for the affiliate links, those don't change, right? Because if they don't then I can potentially make it a configuration option.

pr110 commented 4 years ago

Affiliates don’t change. That would be great if you could implement them somehow. I tried to set up a bot that responds with the link, but I don’t think bots can communicate with other bots.

Also, there is nothing clickable in what it sends. D18275B0-FDD8-441D-AF10-21B5E2DF44B8

SpikeHD commented 4 years ago

Looks like you're using a slightly older version of the bot, so git pull and look at the "Moving to 1.1.0" section in the README to update. After that they should be clickable.

Could you send me an example of a link with a affiliate code attached? I assume it's just https://www.amazon.com/dp/B014UYHJWS/?ref=whatevertherefferalcodeis, right?

pr110 commented 4 years ago

So I cd the folder in cmd, enter git pull, and It’ll update the contents automatically?

Also, here’s an affiliate example : https://www.amazon.com/dp/B014UYHJWS/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=switchlists-20&linkId=3e7911d980e988da728de1cc30cd3e5e&language=en_US

I usually use links that are only for Amazon’s MSRP price listing and the affiliate code is the “tag =“section.

This one is the specific offer page :

https://www.amazon.com/gp/offer-listing/B07VGRJDFY/ref=as_li_ss_tl?ie=UTF8&m=ATVPDKIKX0DER&mv_color_name=1&mv_style_name=0&linkCode=ll2&tag=switchlists-20&linkId=0a5b1e144e71f8bc9b4fae75b36e32a2&language=en_US

SpikeHD commented 4 years ago

You'll also need to run the MySQL command stated in the 1.1.0 section of the README as well but yes, it'll all be updated automatically.

Since the referral stuff looks simple enough I'll see about trying to implement that today.

SpikeHD commented 4 years ago

Added a URLParams option in the config. You can take another look at the README and scroll to the section that explains it.

pr110 commented 4 years ago

Thanks for adding it. URLParams can just be added to config.json I'm assuming.

For each element this example link, is ref all this (as_li_ss_tl?ie=UTF8&m=ATVPDKIKX0DER&linkCode=ll2&). I know the tag is switchlists-20. What else could be in etc. It seems, looking at other ref links, that the only thing that changes according to the specific link is the tag and the link ID. Is the implementation changing the link that it sends under the current price in the bot response?

(General link/no linkId) https://www.amazon.com/gp/offer-listing/B07VGRJDFY/ref=as_li_ss_tl?ie=UTF8&m=ATVPDKIKX0DER&mv_color_name=1&mv_style_name=0&linkCode=ll2&tag=switchlists-20

(Unique link/linkId included) https://www.amazon.com/gp/offer-listing/B07VGRJDFY/ref=as_li_ss_tl?ie=UTF8&m=ATVPDKIKX0DER&mv_color_name=1&mv_style_name=0&linkCode=ll2&tag=switchlists-20&linkId=0a5b1e144e71f8bc9b4fae75b36e32a2&language=en_US

SpikeHD commented 4 years ago

I honestly don't know what all contributes to it being properly tracked as a referral, but I assume the only one you really need is ref=as_li_ss_tl and maybe tag=switchlists-20 .

Using Linus Tech Tips' Amazon referral page as an example, you can click on any of them and the only addition to the URL is ref=exp_linustechtips_dp_vv_d, so I doubt you need things like the linkId to be tracked

pr110 commented 4 years ago

Do you think this looks fine? { "prefix":"$", "token":"X", "sql": { "host":"localhost", "database":"AmazonMonitor", "user":"root", "password":"X" }, "guild_item_limit":5, "required_perms":[] "URLParams":{ "ref":"as_li_ss_tl", "tag":"X" }

SpikeHD commented 4 years ago

You forgot a comma after required_perms, so just make it look like this:

{
  "prefix": "$",
  "token": "X",
  "sql": {
    "host": "localhost",
    "database": "AmazonMonitor",
    "user": "root",
    "password": "X"
  },
  "guild_item_limit": 5,
  "required_perms": [],
  "URLParams": {
    "ref": "as_li_ss_tl",
    "tag": "X"
  }
}
pr110 commented 4 years ago

Thanks.

I also found out the condensed affiliate link formula is this :

Amazon.com Homepage: http://www.amazon.com/?tag=your_Associates_ID

Detail Page: http://www.amazon.com/dp/ASIN/?tag=your_Associates_ID

I don’t know if it would help with determining what’s necessary in the code.