• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Monitor stories from news outlets for words or phrases that matter to you

Track The News

trackthenews is the script that powers @FOIAfeed, a Twitter bot that monitors news outlets for reporting that incorporates public records laws like the Freedom of Information Act (FOIA), and tweets links to and excerpts from matching articles. The underlying software can track any collection of RSS feeds for any keywords.

If you want to run your own instance of trackthenews, you can download and install the package, and run its built-in configuration process. It can be installed with pip:

Python 3.6 is recommend, but if you run into troubles, you may want to try it with Python 2.7.

pip3 install trackthenews

or by cloning the GitHub repository and running setup.py:

python3 setup.py install

Once it is installed, you can create a configuration by running the following command in the appropriate directory:

trackthenews --config

By default, the script will place all configuration files in a new ttnconfig folder in your current working directory, but you can also designate a directory for it to use.

python3 trackthenews --config ~/foo/bar/path

That configuration process will create the necessary files and walk you through setting up a Twitter bot for matching stories. After it is configured, you'll need to use a text editor to add the matchwords and RSS feeds to their respective files.

Sample RSS feed and matchword files can be found in the project's GitHub repo. The RSS feed file is a JSON array of objects corresponding to each feed. Each object requires a url field, and should also have an outlet field.

The next two fields are optional: if you know the feed uses redirect URLs, you may set redirectLinks to true and the script will attempt to follow those redirects to store and tweet canonical URLs; if the feed uses URLs that depend on query- or hash-strings to display correctly—basically, if the content relies on text in the URL bar after a ? or #—you can set delicateURLs to true and the script will leave the URLs exactly as is.

Once you've got everything set up, you can run the program without the --config flag to check for matching articles.

trackthenews

If you designated a custom installation directory, or if you're running it from another directory (or a cron job, for example) you will need to designate the directory in which the configuration files are installed.

trackthenews ~/foo/bar/path

Settings, such as the background color for new posts, the font, and the user-agent, are all located in config.yaml, in the designated configuration directory.

How it works

Most of the script is dedicated to the Article class.

  • Articles are created based on inputs. Currently those inputs are RSS feeds, which are stored in rssfeeds.json, but in future versions other inputs will include direct URLs, news APIs, Twitter feeds, or scraped pages.
  • A series of Article methods then scrape and isolate the contents of each article (currently that cleanup is done with a Python port of Readability, but future versions may incorporate some per-site parsing), check whether it's suitable for posting, and then prepare images for tweeting.
  • Finally, the Article tweets itself.

All articles are recorded in a sqlite database.

Advanced feature: blocklist

In some cases, you may wish to suppress articles from being posted, even though they would otherwise match. You can do so by writing a new function, check, and placing it in a file named blocklist.py in the configuration directory. check takes an Article (and so has access to its outlet, title, and url) and should return true for any article that should be skipped.

License

MIT.

More Repositories

1

securedrop

GitHub repository for the SecureDrop whistleblower platform. Do not submit tips here!
Python
3,609
star
2

dangerzone

Take potentially dangerous PDFs, office documents, or images and convert them to safe PDFs
Python
3,553
star
3

encryption-works

Encryption Works: How to Protect Your Privacy in the Age of NSA Surveillance
353
star
4

sunder

Sunder is a user-friendly graphical interface for Shamir's Secret Sharing.
JavaScript
160
star
5

securedrop-workstation

Qubes-based SecureDrop Journalist Workstation environment for submission handling
Python
138
star
6

securethenews

An automated scanner and web dashboard for tracking TLS deployment across news organizations
Python
100
star
7

ansible-role-grsecurity

The documentation and build system for the grsecurity kernel maintained by the Freedom of the Press Foundation for SecureDrop
Python
49
star
8

gotham-grabber

Python
48
star
9

securedrop-protocol

Research and proof of concept to develop the next SecureDrop with end to end encryption.
Python
47
star
10

securedrop-client

a Qt-based GUI for SecureDrop journalists 📰🗞️
Python
41
star
11

securedrop.org

Code for the SecureDrop project website
Python
40
star
12

fingerprint-securedrop

A machine learning data analysis pipeline for analyzing website fingerprinting attacks and defenses.
Python
29
star
13

signal-protocol

Python bindings to libsignal-protocol-rust
Python
24
star
14

ansible-role-jitsi-meet

Installs the Jitsi Meet open source videoconferencing software
Ruby
23
star
15

securedrop-docs

Documentation for the SecureDrop project
Shell
22
star
16

ansible-role-elk

Installs a turnkey ELK stack for log aggregation and analysis, with optional Riemann support for alerting
Ruby
18
star
17

pressfreedomtracker.us

Code for the U.S. Press Freedom Tracker project website
Python
17
star
18

ansible-role-build-debian-package

Ansible role for building Debian packages (.deb files) for distributing installers
17
star
19

threat-modeling

experimental threat modeling tools
Python
14
star
20

securedrop-sdk

Tooling for developing against the SecureDrop API
10
star
21

securedrop-https-everywhere-ruleset

HTTPS Everywhere ruleset for human-readable Onion URLs for SecureDrop instances
Python
10
star
22

ansible-role-jenkins-config

Repo to further configure jenkins post install
Groovy
9
star
23

securedrop-ux

Public wiki and repository for the SecureDrop User Experience team
HTML
8
star
24

npm-audit-plus

A wrapper around NPM's built-in audit that adds extra features
JavaScript
8
star
25

securedrop-proxy

Qubes RPC proxy service for the SecureDrop Client
8
star
26

securedrop-i18n

securedrop translations - do not install from here or file PRs here! please use https://github.com/freedomofpress/securedrop
Python
7
star
27

securedrop-builder

Packaging logic for building SecureDrop-related Debian packages
Python
7
star
28

qubes-template-securedrop-workstation

Build the base Qubes VM template for the SecureDrop Workstation
Makefile
7
star
29

ossec

This repository contains all of the code and documentation related to the generic OSSEC packages maintained by the Freedom of the Press Foundation for all SecureDrop instances.
Shell
7
star
30

securedrop-workstation-docs

User documentation for the SecureDrop Workstation
Dockerfile
5
star
31

securedrop-signal-poc

prototype e2e server and source + journalist clients for securedrop
Rust
5
star
32

ansible-role-elastalert

Elastalert ansible role
5
star
33

ansible-role-beats

Ansible role for installing and configuring elastic beats
Makefile
5
star
34

ansible-role-grsecurity-build

Ansible role for building grsecurity-patched kernels from source
Roff
5
star
35

dangerzone.rocks

Contents of the dangerzone.rocks website
CSS
5
star
36

securedrop-export

code for exporting from the securedrop qubes workstation
5
star
37

containers

Repo to house all FPF related containers
Python
4
star
38

ansible-role-signal-desktop

Python
4
star
39

securedrop-apt-test

Artifact storage for SecureDrop packages (dev only)
Python
4
star
40

kernel-builder

Roff
4
star
41

build-logs

Build logs for SecureDrop core and workstation packages
Roff
4
star
42

securedrop-dev-docs

SecureDrop Developer Documentation
Shell
4
star
43

secure-fs

An open-source library that ensures restrictive file permissions and safe paths when creating and working with files and directories.
Python
4
star
44

otter

Infrastructure framework for Qubes-OS based testing on VMWare
Python
3
star
45

ansible-role-riemann

Ansible role for configuring the Riemann stream processor for alerting on Logstash events.
Ruby
3
star
46

ansible-role-paxctld

Set PaX flags on binaries via a system service, for grsecurity-patched kernels
2
star
47

securedrop-styleguide

The styleguide for the SecureDrop project
HTML
2
star
48

ansible-role-ntfy

Ansible role for installing the ntfy pip module for sending notifications
2
star
49

sdstatus

Rust
2
star
50

ansible-role-docker-registry

Configures a self-hosted Docker registry
Python
2
star
51

wagtail-supertable

▦ Extensions for Wagtail's built-in table block
JavaScript
2
star
52

securedrop-reachability-monitor

Nagios gives a lot of false positives that SecureDrop instances are down. We're going to use stem to get to the bottom of why.
Python
2
star
53

securedrop-log

centralized logging for AppVMs in qubes
2
star
54

ansible-role-django

Ansible role for django development
HTML
1
star
55

ansible-role-grsecurity-install

Ansible role for installing grsecurity kernel Debian packages
Python
1
star
56

securedrop-grsec

Debian metapackage for SecureDrop grsecurity-hardened kernels
1
star
57

ansible-role-kibana

Kibana ansible role
Python
1
star
58

foiafeed-ttnconfig

Configuration files for the FOIA Feed instance of Track The News
Python
1
star
59

signal-groups

python bindings to signal's zkgroup
Rust
1
star
60

ansible-role-doctl

Configures doctl command line client for DigitalOcean API
Python
1
star
61

container-onion-service

Shell
1
star
62

securedrop-workstation-ci

Repository for holding scripts related to running CI for SecureDrop Workstation (hosted on a Qubes machine)
Python
1
star
63

fpf-misc-resources

1
star
64

ansible-role-openssl-node

Utilizes a pre-existing CA certificate to generated signed client openssl certs
1
star
65

wa-knn-fingerprint-securedrop

An implementation of Wang's kNN classifier intended for integration with the https://github.com/freedomofpress/fingerprint-securedrop machine learning pipeline.
Go
1
star
66

securedrop-yum-test

Artifact storage for SecureDrop Workstations RPM packages (dev only)
Python
1
star
67

.github

Templates and community guidelines shared across public FPF repositories
1
star
68

securedrop-yum-prod

Artifact storage for SecureDrop Workstations RPM packages (production)
Python
1
star
69

apt-tools-prod

Artifact storage for Dangerzone and other non-SD .deb packages
Python
1
star
70

yum-tools-prod

Artifact storage for Dangerzone and other non-SD .rpm packages
Python
1
star
71

securedrop-protocol-server-resty

OpenResty implementation of the experimental SecureDrop-ng server protocol
Lua
1
star
72

maint-dangerzone-pyside6

Build instructions for creating a PySide6 RPM, which is currently missing from the official Fedora repos.
Shell
1
star