# README

This document elaborates the different steps that we went through to collect, store, and process data to investigate the Swedish climate obstruction network (hereafter referred to as CON) *klimatsans* (Climate Sense/Reason).

Files preceded with "step[number]_" are mentioned and explained in this document. Furthermore, file "plots.R" is used to generate the plots found in the article.

## 1) Download of daw data

Collected 1 August 2022 by mirroring the network's website using the command line tool `httrack` (excluding images):

`httrack https://klimatsans.com/ -W -O "~/googla_blogs"  -%v -K --skeleton`

The blog posts are pages corresponding to the regular expression pattern: `\d{4}/\d{2}/\d{2}/[^/]+/index.html`

A total of 2654 posts published from 3 Jan 2014 to 31 July 2022 were retrieved.

## 2) Extraction of hyperlinks

Hyperlinks were extracted from the content (HTML id `#main`) of the blog posts from the network's blog. This is done using the python script `step2_extract_urls.py` and ignores the following links:

* relative links
* same-domain links
* social links
* links in the author profile in the comment section
* pingbacks

The resulting data is a tab-separated file in `step2_all_hyperlinks.tsv` with the following columns:

* [unnamed id column]
* source: file name (without extension) where the link was found
* date: date of the blog post based on the file name
* url: the linked URL
* domain: the complete domain of the URL including all subdomains (e.g. en.wikipedia.org)
* main: the top-level and second-level domain of the URL (e.g. wikipedia.org)
* text: the clickable text of the link

## 3) Identification of googling

We identified 268 occurrences of the term "googla" in 177 different blog posts. We processed these on a linux command line to obtain relevant content (from `div#content.site-content`) with output in markdown format:

1. `egrep -Ril -r 'googla' blog | grep -e '20[12][0-9]/[01][0-9]/[0-3][0-9]' | sort > __matching_files.txt`
2. `for F in $(cat ./__matching_files.txt); do cp $F _matching/${${${F//\//_}//blog_/}//_index/}; done`
3. `sed -i -n '/<div id="content" class="site-content" role="main">/,/<\/div><!-- #content -->/p' blog_intermediate/*`

Pandoc was then used to transform these 177 files to plain text.

## 4) Extraction of suggested queries

Using full-text search, we transformed all mentions of "googla" into a spreadsheet. We then identified and tabulated all explicitly suggested queries. We only included those that follow an imperative verb and are quoted or follow a colon. To avoid uncertainty about "correct" queries, we excluded imperative verbs without directly following keyphrases.

## 5) Query coding

Thereafter, all queries were coded using the coding scheme from `step5_queries_coding_scheme.md`. The coded queries are available in file `step5_queries.tsv` with the following columns:

* query_term: verbatim suggested
* total: total number of occurrences in the blog
* types: comma separated list of how terms are embedded in text; quoted term in quotation marks, brackets for term and imperative in brackets, explicit for term following directly the imperative (including after colon)
* dates: dates of the blog posts where the query occurs
* n_chars: [calculation] number of characters of the query including whitespaces
* n_words: [calculation] number of words in the query
* ch_p_w: [calculation] number of characters per word
* Columns lang, grammatical, mode, special_words, theme: see coding scheme.

## 6) Subset of queries

We created a set of 25 queries to use as starting points for further data creation. We investigated further all 10 queries with four or more uses:

* koldioxid växt välgörande 12
* fusk i klimatdebatten 11
* röda tråd nwo 10
* koldioxidens verkan på klimatet 7
* vindstilla europa 7
* koldioxidens verkan klimatet 5
* som driver ipcc 5
* pulkovo kallare 4
* solen jorden kallare 4
* tysk el april 2016 4

We investigated further 6 out of 8 queries with three uses:

* figueres intentionally 3
* rena klimatfakta 3
* rena observerade klimatfakta 3
* svt solens aktivitet 3
* välgörande fao 3
* vindkraft i verkligheten 3

We investigated further 9 out of 20 queries with two uses:

* växt koldioxid välgörande 2
* fusk klimatdebatten 2
* fusk temperaturdata 2
* klimatförändringarnas verklighet 2
* observerade klimatfakta 2
* klimatsans energifakta 2
* pulkovo solen kallare 2
* vegetarisk nyttigare graz 2
* humlum cool 2

## 7) Newspaper search for frequent queries

All 25 selected queries were searched for in the newspaper database Retriever using the verbatim "query". The search was run using selected Swedish printed outlets, i.e. not web, not TV & radio, not sectoral news (branschmedia); resulting in a total of 625 sources. The search covered the time from 1 January 2014, to the end of July 2022.

All occurrences of the respective phrases in newspapers are tabulated in `step7_query_tracing.tsv` with the following columns:

* query_term: the respective keyphrase searched for
* date: the date at which a newspaper article or blog post was published in YYYY-MM-DD format
* source: newspaper or blog
* role: one of googla (for an explicit appeal to google a keyphrase), general (when the keyphrase is included in ordinary text), title (when the keyphrase is part of the article's or post's title)

Note that for the blog (source=blog), the use of the keyphrase as title or in text (role=title, role=general) has only been done for the queries: "röda tråd nwo", "koldioxidens verkan på klimatet", and "som driver ipcc" that are also discussed in the paper.

## 8. Search engine results pages for frequent queries

On 6 and 7 March 2023, we crawled the queries with the Result Assessment Tool [1] on both Google and DuckDuckGo as: (1) normal search: <query>; (2) search for query: googla + <query>; (3) verbatim search: "<query>".

A summary of the search engine result pages for the 25 queries of this analysis are stored in
`step8_serp_results.tsv`. The full data is available via [2]. The columns in the attached file are as follows:

* result_id: unique identifier
* query_id: identifier of the query_term used
* search_type: whether the query was conducted "plain", "verbatim" in quotation marks, or preceeded by the term "googla"
* query_term: keyphrase used for search
* Position: position of the result in the search engine results page; top result is always 1, no more than 10 results recorded
* URL: full URL to the result
* Main: domain of the URL
* Title: title or the result page
* source: whether searched via "google" or "duckduckgo"
* relation_to_network: "own blog" if the result is on the domain of the network's blog; "network/author mentioned" if somewhere in the HTML page of the result, the name of the network "klimatsans" or its secretary is mentioned; "not mentioned" if this is not the case; "NA" if no data was available

[1] Lewandowski, D., Sünkler, S., Yagci, N., Schultheiß, S., Sygulla, D., & Von Mach, S. (2022). Result Assessment Tool (RAT). https://doi.org/10.17605/OSF.IO/T3HG9

[2] Sünkler, S., Rödl, M., Lewandowski, D., Yagci, N., Schultheiß, S., Sygulla, D., & Mach, S. von. (2023). RAT data with SEO classification on Swedish climate denier search queries sent to DuckDuckGo and Google. https://doi.org/10.17605/OSF.IO/EQDMW

## 9) Mentions of the CON

Using the full-text where available, we investigated whether the network or its authors are mentioned in the search engine results. See the point above, column "relation_to_network".

## 10) Coding of frequent domains

We coded all frequent domains, which included domains targeted by either: at least 10 hyperlinks (from step 2); at least 2 times in the search results (from step 8); or at least 4 hyperlinks and 1 search result. All domains meeting these criteria are coded in `step10_coded_domains.tsv` with the following columns:

* domain: domain of the target
* n.links: number of links to this domain
* n.serps: number of search results to this domain
* site_type: what kind of site this is; blog, media (for national and other media outlets), media/regional (for regional newspapers), media/sectoral (for sectoral news), media/science (for science communication platforms), agency (for agencies, authorities, etc), other (for anything else).
* language: language of the website; swedish, english, international (for international agencies etc), and "other/multi" (for platforms, and other languages).