aboutsummaryrefslogtreecommitdiffstats
path: root/notes/longtail_crawl.txt
blob: 20cdad30b9dea20ba1672ef065385c9a05871895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

## 2020 Crawl Query

    .mode tabs
    .output longtail_homepage_urls.tsv

    SELECT homepage.url, homepage.issnl
    FROM homepage
    LEFT JOIN journal ON homepage.issnl = journal.issnl
    WHERE
        (homepage.terminal_status_code = 200 or homepage.blocked or homepage.terminal_status_code is null)
        AND homepage.domain != 'archive.org'
        AND homepage.host NOT LIKE '%scielo%'
        AND homepage.domain != 'jst.go.jp'
        AND homepage.host != 'books.google.com'
        AND homepage.host != 'www.google.com'
        AND homepage.domain != 'oclc.org'
        AND homepage.host != 'www.ncbi.nlm.nih.gov'
        AND homepage.domain != 'umi.com'
        AND homepage.domain != 'doi.org'
        AND homepage.host != 'www.thefreelibrary.com'
        AND (journal.is_longtail = 1
            OR journal.publisher_type = 'society'
            OR journal.publisher_type = 'unipress' 
            OR journal.publisher_type IS NULL)
        AND (journal.has_dois = 0 or journal.release_count < 20);

## Older 2019 Crawl Query

    .mode tabs
    .output longtail_homepage_urls.tsv

    SELECT homepage.url, homepage.issnl
    FROM homepage
    LEFT JOIN journal ON homepage.issnl = journal.issnl
    WHERE
        homepage.terminal_status_code = 200
        AND journal.is_longtail = 1
        AND homepage.domain != 'archive.org'
        AND homepage.host NOT LIKE '%scielo%'
        AND homepage.domain != 'jst.go.jp'
        AND homepage.host != 'books.google.com'
        AND homepage.host != 'www.google.com'
        AND journal.has_dois = 0;

## Test Queries

    SELECT count(distinct homepage.issnl) FROM homepage LEFT JOIN journal ON homepage.issnl = journal.issnl WHERE homepage.terminal_status_code = 200 AND journal.is_longtail = 1;

    SELECT ... FROM homepage LEFT JOIN journal ON homepage.issnl = journal.issnl WHERE homepage.terminal_status_code = 200 AND journal.is_longtail = 1;

    SELECT homepage.domain, COUNT(*) FROM homepage LEFT JOIN journal ON homepage.issnl = journal.issnl WHERE homepage.terminal_status_code = 200 AND journal.is_longtail = 1 AND homepage.domain != 'archive.org' AND homepage.host NOT LIKE '%scielo%' AND homepage.domain != 'jst.go.jp' AND homepage.host != 'books.google.com' AND homepage.host != 'www.google.com' AND journal.has_dois = 0
    GROUP BY homepage.domain ORDER BY COUNT(*) DESC LIMIT 20;

    SELECT homepage.suffix , COUNT(*) FROM homepage LEFT JOIN journal ON homepage.issnl = journal.issnl WHERE homepage.terminal_status_code = 200 AND journal.is_longtail = 1 AND homepage.domain != 'archive.org'
    GROUP BY homepage.suffix ORDER BY COUNT(*) DESC LIMIT 20;