Compare commits

...

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian ed92919c0d 1.228.7 2023-06-19 05:19:51 +02:00
DebaucheryLibrarian b5309005e9 Using affiliate parameters for Bang, fixed affiliate URL composition on entity page. 2023-06-19 05:19:49 +02:00
4 changed files with 14 additions and 6 deletions

View File

@ -157,12 +157,14 @@ async function fetchEntity(scroll = true) {
const campaign = entity.campaigns.find((campaignX) => !campaignX.banner)
|| entity.parent?.campaigns.find((campaignX) => !campaignX.banner);
const { searchParams, pathname, origin } = new URL(entity.url);
const affiliateParams = new URLSearchParams({
...(entity.url && Object.fromEntries(new URL(entity.url).searchParams)), // preserve any query in entity URL, e.g. ?siteId=5
...(entity.url && Object.fromEntries(searchParams)), // preserve any query in entity URL, e.g. ?siteId=5
...(campaign?.affiliate?.parameters && Object.fromEntries(new URLSearchParams(campaign.affiliate.parameters))), // append affiliate parameters
}).toString();
this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${entity.url}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`;
this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${origin}${pathname}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`;
this.done = true;
if (scroll && this.$refs.filter?.$el) {

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.228.6",
"version": "1.228.7",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.228.6",
"version": "1.228.7",
"license": "ISC",
"dependencies": {
"@casl/ability": "^5.2.2",

View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.228.6",
"version": "1.228.7",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {

View File

@ -15,6 +15,12 @@ const affiliates = [
parameters: 't=eyJhZmZpbGlhdGUiOiJEZWJhdWNoZXJ5TGliIiwiY2FtcGFpZ24iOiJkZWZhdWx0IiwiYWdldmVyaWZpZWQiOiJ5In0',
comment: '50%',
},
{
id: 'bang_signup',
network: 'bang',
parameters: 't=eyJhZmZpbGlhdGUiOiJEZWJhdWNoZXJ5TGliIiwiY2FtcGFpZ24iOiJkZWZhdWx0IiwiYWdldmVyaWZpZWQiOiJ5In0',
comment: '$25 per signup',
},
];
const bannerTags = {
@ -241,7 +247,7 @@ const campaigns = [
// bang
{
network: 'bang',
url: 'https://www.bang.com/?aff=eyJ3IjoiMTQ1ODYiLCJsIjoiMzE2NDYiLCJ0IjoiNDU4NjEifQ==',
affiliate: 'bang_signup',
comment: 'per signup',
},
// julesjordan