Skip to main content

A project to look at the greatest hits of news about a specific topic and add that to a blog

Project description

Retrospective

A retrospective exhibition presents works from an extended period of an artist's activity. Similarly, a retrospective compilation album is assembled from a recording artist's past material, usually their greatest hits. A television or newsstand special about an actor, politician, or other celebrity will present a retrospective of the subject's career highlights. A leading (usually elderly) academic may be honored with a Festschrift, an honorary book of articles or a lecture series relating topically to a retrospective of the honoree's career. Celebrity roasts good-naturedly mock the career of the guest of honor, often in a retrospective format.

This project seeks to create a 'retrospective' of Google News top hits. Retrospective takes a search term and searches Google News multiple times throughout a specified time range. It then parses this data and outputs a title, summary, image, and link for use in a blog or other project.

Installation

Install requirements

pip install -r requirements.txt

Upgrade Selenium

pip install -U selenium

Install ChromeDriver

Download ChromeDriver

Save to /usr/local/bin/chromedriver

On a Mac, you will need to give security permissions to chromedriver:
cd /usr/local/bin
xattr -d com.apple.quarantine chromedriver

Other OS may have similar procedures.

Once ChromeDriver is installed, Retrospective will keep it up to date with your current Chrome version

Configure AWS CLI

Retrospective sets up and uses AWS EC2 instances as proxies.

You must configure AWS CLI if you haven't already.

Tests

python Retrospective/test.py

Usage

Basic search for bioinformatics (console print out):

python Retrospective/Retrospective.py -t bioinformatics

-t specifies search term

Add articles to blog:

python Retrospective/Retrospective.py --repo /Users/my-user/my-website -t bioinformatics -c /content/blog -i /static/images --write-framework hugo

--repo specifies absolute directory of your blog or website

-c specifies the content path - i.e. where the blog posts live

-i specifies the image path - i.e. where the images live

--write-framework specifies the framework that retrospective creates posts for. Options are only 'hugo' and None. None will print output.

Adjust time period, window, and span:

python Retrospective/Retrospective.py -t bioinformatics -s 2 -p 6 -w 8

-s specifies time span in which the total search takes place, in years. Specifying 2 will search up to 2 years in the past. Default is 2.

-p specifies time period in which separate queries will take place, in months. Specifying 6 will create a new search every 6 months for the entire span. Default is 6.

-w specifies Time window in which individual queries take place, in weeks. Specifying 8 will look at all articles over an 8 week period for every individual search as specifies by the period and span. Default is 8.

From Config

Retrospective automatically populates a config file (retrospective.json by default) within the specified repository. This is intended to save your previous searches so that retrospective can be easily rerun and updated at a future time.

The --from-config option will carry out all previous searches saved in the config file, updated for the current date. You can manually edit the json file if you want to add more searches. This is the easiest way to manage using retrospective in a blog.

Example:

python Retrospective/Retrospective.py --repo /Users/my-user/my-website -c /content/blog -i /static/images --write-framework hugo --from-config

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

springbok-retrospective-0.0.1.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

springbok_retrospective-0.0.1-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file springbok-retrospective-0.0.1.tar.gz.

File metadata

  • Download URL: springbok-retrospective-0.0.1.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for springbok-retrospective-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7b5fea8b09fea804538165d5826a2e1bed4566cd187a41fedc800d7aa147ca62
MD5 743252fb9cac7482649a5e9ffa2f0f1e
BLAKE2b-256 c1425897ab83269840127d82bb166d9ca1b31a7af43c09a4112f17dc627853c9

See more details on using hashes here.

File details

Details for the file springbok_retrospective-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for springbok_retrospective-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f6d57d08f9bef38f036a3cebf8fdc5c422c44c87ec1df97df6bb37a632d3fad
MD5 4d3d8ce53f8ed5d7e2e5d8def232d44c
BLAKE2b-256 df808f699c2a577db3d68a7d807156dbbf6dcb6090d3de120b22e13ece9f2a6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page