Added Arch Angel, updated BAM Visions scraper to accomodate Arch Angel (different network, same unidentified CMS).
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
const bulkInsert = require('../src/utils/bulk-insert');
|
||||
|
||||
const affiliates = [
|
||||
{
|
||||
id: 'archangel_share',
|
||||
channel: 'archangel',
|
||||
url: 'https://join.archangelvideo.com/track/MzQ3LjEuMS4xLjAuMC4wLjAuMA',
|
||||
comment: 'revshare',
|
||||
},
|
||||
];
|
||||
|
||||
const banners = [
|
||||
{
|
||||
id: '21sextury_300_250_anal',
|
||||
@@ -78,6 +87,13 @@ const banners = [
|
||||
network: '21naturals',
|
||||
tags: ['sex', 'brunette'],
|
||||
},
|
||||
{
|
||||
id: 'archangel_970_90_kendra_lust',
|
||||
width: 970,
|
||||
height: 90,
|
||||
channel: 'archangel',
|
||||
tags: ['dp', 'anal', 'sex', 'interracial', 'black'],
|
||||
},
|
||||
{
|
||||
id: 'evilangel_728_90_adriana_chechik_gangbang',
|
||||
width: 728,
|
||||
@@ -352,6 +368,15 @@ const campaigns = [
|
||||
url: 'https://www.iyalc.com/21naturals/go.php?pr=8&su=1&si=209&ad=277470&pa=index&ar=&buffer=',
|
||||
comment: 'per signup',
|
||||
},
|
||||
{
|
||||
channel: 'archangel',
|
||||
affiliate: 'archangel_share',
|
||||
},
|
||||
{
|
||||
channel: 'archangel',
|
||||
affiliate: 'archangel_share',
|
||||
banner: 'archangel_970_90_kendra_lust',
|
||||
},
|
||||
{
|
||||
network: 'brazzers',
|
||||
url: 'https://landing.brazzersnetwork.com/?ats=eyJhIjozMTYwOTcsImMiOjU5MzI1Mzk5LCJuIjoxNCwicyI6OTAsImUiOjg4MDMsInAiOjExfQ==',
|
||||
@@ -624,6 +649,7 @@ exports.seed = async knex => Promise.resolve()
|
||||
await knex('banners_tags').delete();
|
||||
|
||||
await Promise.all([
|
||||
knex('affiliates').delete(),
|
||||
knex('campaigns').delete(),
|
||||
knex('banners').delete(),
|
||||
]);
|
||||
@@ -643,6 +669,13 @@ exports.seed = async knex => Promise.resolve()
|
||||
const channelsBySlug = channels.reduce((acc, channel) => ({ ...acc, [channel.slug]: channel }), {});
|
||||
const tagsBySlug = tags.reduce((acc, tag) => ({ ...acc, [tag.slug]: tag }), {});
|
||||
|
||||
const affiliatesWithEntityId = affiliates.map(affiliate => ({
|
||||
id: affiliate.id,
|
||||
entity_id: networksBySlug[affiliate.network]?.id || channelsBySlug[affiliate.channel]?.id || null,
|
||||
url: affiliate.url,
|
||||
comment: affiliate.comment,
|
||||
}));
|
||||
|
||||
const bannersWithEntityId = banners.map(banner => ({
|
||||
id: banner.id,
|
||||
width: banner.width,
|
||||
@@ -659,9 +692,11 @@ exports.seed = async knex => Promise.resolve()
|
||||
const campaignsWithEntityIdAndAffiliateId = campaigns.map(campaign => ({
|
||||
entity_id: networksBySlug[campaign.network]?.id || channelsBySlug[campaign.channel]?.id,
|
||||
url: campaign.url,
|
||||
affiliate_id: campaign.affiliate,
|
||||
banner_id: campaign.banner,
|
||||
})).filter(link => link.entity_id && link.url);
|
||||
})).filter(link => link.entity_id && (link.url || link.affiliate_id));
|
||||
|
||||
await knex('affiliates').insert(affiliatesWithEntityId);
|
||||
await bulkInsert('banners', bannersWithEntityId, false);
|
||||
await bulkInsert('banners_tags', bannerTags, false);
|
||||
await bulkInsert('campaigns', campaignsWithEntityIdAndAffiliateId, false);
|
||||
|
||||
Reference in New Issue
Block a user