Created
February 25, 2019 19:26
-
-
Save wakawaka54/23b4d1cb352686cd99c40a8cdf3f6f86 to your computer and use it in GitHub Desktop.
Dynamic AliExpress Affiliate Link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Slf4j | |
public class AffiliateInformationProvider { | |
private final static String AFFILIATE_BASE_URL = "http://s.click.aliexpress.com/deep_link.htm"; | |
private final static String AFFILIATE_SHORT_KEY = "YOUR_SHORT_KEY"; | |
public String getAffiliateUrl(String detailUrl) { | |
URL url = UrlBuilder.fromString(AFFILIATE_BASE_URL) | |
.addParameter("dl_target_url", detailUrl) | |
.addParameter("aff_short_key", AFFILIATE_SHORT_KEY) | |
.toUrl(); | |
return url.toExternalForm(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, can you tell me how where i can find short key ?