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
CASE | |
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(mirror.co.uk|dailyrecord.co.uk|irishmirror.ie|insider.co.uk|belfastlive|glasgowlive|dublinlive|rsvplive.ie).*$")) THEN "Nationals" | |
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(manchestereveningnews.co.uk|liverpoolecho.co.uk|walesonline|birminghammail|chroniclelive|bristolpost|hulldailymail|nottinghampost|plymouthherald|leicestermercury).*$")) THEN "Regional Capitals" | |
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(derbytelegraph|gazettelive|stokesentinel|coventrytelegraph|examiner|cambridge-news|grimsbytelegraph|chesterchronicle|leeds-live|getwestlondon|burtonmail|scunthorpetelegraph).*$")) THEN "Urban Hub" | |
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(croydonadvertiser|hertfordshiremercury|birminghampost|macclesfield-express|crewechronicle|rossendalefreepress|accringtonobserver|loughboroughecho|hinckleytimes).*$")) THEN "Community Sites" | |
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?(dailypost|devonlive|gloucestershirelive|getsurrey|somerse |
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
CASE | |
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?/all-about/.*?")) THEN "Topic" | |
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?-[0-9]+$")) THEN "Article" | |
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),"^https?://[^/]+/.*?/$")) THEN "Section" | |
WHEN (REGEXP_MATCH(Page/Screen Path (Clean),"^https?://[^/]+/$")) THEN "Home" | |
ELSE "(Other)" | |
END |
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
CASE | |
WHEN (country="United Kingdom") THEN "UK" | |
WHEN (country="United States") THEN "USA" | |
WHEN (country="India") THEN "India" | |
WHEN (country="Ireland") THEN "Ireland" | |
ELSE "(Other)" | |
END |
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
CASE | |
WHEN ((Source="direct" AND Medium="(not set)") OR Medium="(none)") THEN "Direct" | |
WHEN Medium="organic" THEN "Organic Search" | |
WHEN (Social Source Referral="Yes" OR REGEXP_MATCH(Medium,"^(social|social-network|social-media|sm|social network|social media)$")) OR REGEXP_MATCH(Source,"(facebook|t.co|reddit|fark|linkedin|pinterest)") THEN "Social" | |
WHEN Medium="email" THEN "Email" | |
WHEN Medium="referral" and not(REGEXP_MATCH(Source,"(facebook|t.co|reddit|fark|linkedin|pinterest)") ) THEN "Referral" | |
ELSE "(Other)" | |
END |
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
#!/usr/bin/env perl | |
use Modern::Perl; | |
use Mojo::UserAgent; | |
use Mojo::JSON qw(decode_json); | |
use Image::Size qw(imgsize); | |
use POSIX; | |
my $urls = [...]; |
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
sub float2rat { | |
my $x = shift; | |
my $tolerance = 1.0E-6; | |
my $h1 = 1; | |
my $h2 = 0; | |
my $k1 = 0; | |
my $k2 = 1; | |
my $b = $x; | |
do { |
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
#!/usr/bin/env perl | |
use Modern::Perl; | |
use DateTime; | |
my $past = DateTime->now->subtract(months => 6); | |
my $past_year = $past->year(); | |
my $past_month = $past->month(); | |
my $past_2_year = $past->subtract(years => 1)->format_cldr('yy'); | |
my $y_str; |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use DateTime; | |
use FindBin qw($Bin); | |
use Getopt::Long; | |
use Modern::Perl; | |
use Mojo::JSON qw(encode_json); |
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
#!/usr/bin/perl | |
# To run need listen two ports: 80, 443 | |
# sudo morbo 12.pl -l https://*:443?cert%3D%2Fhome%2Flogioniz%2Fcert%2Fserver.crt%26key%3D%2Fhome%2Flogioniz%2Fcert%2Fserver.key%26verify%3D0x00 -l http://*:80 | |
# go to url in browser http://your_ip/qwe/asd | |
use Mojo::Base -strict; | |
use Mojolicious::Lite; |
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
'use strict'; | |
const puppeteer = require('puppeteer'); | |
// Test scenarios | |
// 4 different entrypoints | |
// ~8 different cookie setting scenarios (ie every page has at least 1 video) | |
// 2 different pre-set options - cookies and cookie-less | |
const reqUrls = [ |
NewerOlder