hbang / LinkOpener

Open web pages in their App Store apps.
Other
29 stars 11 forks source link

ebay Rover URLs Do Not Redirect #23

Closed jfelchner closed 7 years ago

jfelchner commented 8 years ago

eBay has a URL format used specifically for affiliates. It basically has the URL embedded in the query params. Tons of links are formatted like this cuz people want dat $$$$

I'd love if opener could parse out the URL from the query params and send me to the eBay app.

The format is something like:

http://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&pub=&toolid=10001&campid=XXXXXXXXXX&customid=&mpre=%20http%3A%2F%2Febay.com

Notice the mpre query param is the URL we actually want. It just needs to be URL decoded.

kirb commented 8 years ago

Do all of them have the %20 before the URL? (Or anything similar I need to strip out?)

jfelchner commented 8 years ago

@kirb no they don't all have that but they could.

Honestly I have no idea how the link opener redirection works. It would be nice if you could just send the whole rover URL to the app and let it decide what to do. Currently the eBay app doesn't support affiliate tagging, but in the future, if it did, then not having link opener break that would be nice.

If sending an entire rover link doesn't work, then I think parsing out the query param is the only option.

Also, here's a more complex example:

http://rover.ebay.com/rover/1/111-11111-11111-1/1?campid=1111111111&customid=xxxxxxxxxx&mpre=http%3A%2F%2Fwww.ebay.com%2Fitm%2F-%2F121802031375%3F_mwBanner%3D0%26rmvSB%3Dtrue%26ul_noapp%3Dtrue

In this case the encoded URL itself has eBay query params in it that tell eBay not to use the app.

So I think the steps would be:

BTW, in case it matters to you, for the URL, the 1s represent a single digit apiece, for the campid they represent one or more digits. The customid it is one or more of any character.

Thanks!

iAdam1n commented 7 years ago

eBay's app now opens rover links itself.