GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fdebijl/NOSedits: Track changes to titles in NOS articles

BranchesTags
Open more actions menu

Latest commit

 

History

271 Commits
271 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
test
test
 
 
.editorconfig
.editorconfig
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
jasmine.config.json
jasmine.config.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

NOSedits

Track changes to titles in NOS articles

How does it work?

NOSEdits receives title changes from OpenTitles. These are checked for validity, once they pass all the tests a tweet is issued that the title has been changed.

Technical Details

NOSEdits uses AMQP to listen for title changes dispatched by OpenTitles. Once a message is received it will be checked for validity by /src/util/validateArticle.ts. If this method passes, it will be passed on to /src/twitter/sendTweet.ts to issue a Tweet for this article. Most checks are self-contained, but to make sure double-posting doesn't happen we also keep track of all Tweets via MongoDB. This database contains all previously issued Tweets with the old title, the new title and the Tweet (formally called a status) as returned by the Twitter API.

The deprecated WebhookListener uses Express to listen for POST requests on localhost:7676/notify, but otherwise uses the same validation methods that the AMQP listener uses.

Building and running

Either locally with dotenv and Node:

npm ci
npm run compile
node -r dotenv/config dist/index.js

Or by using the Dockerfile:

docker image build -t fdebijl/nosedits .
docker container run --publish 7676:7676 --detach --name nosedits fdebijl/nosedits

You will need a set of API keys from Twitter in order to actually send out a Tweet when a changed title is detected. You can get these from the Twitter Developer site. These keys are picked up from the following environment variables:

CONSUMER_KEY
CONSUMER_SECRET
ACCESS_TOKEN
ACCESS_TOKEN_SECRET

dotenv is included as a devDependency, it is recommended to use a .env file for local testing. See /src/config.ts for other relevant environment variables, such as the MongoDB connection string and RabbitMQ exchange URI.

Testing

npm ci
npm run simpletest
# or 'npm run test' when collecting coverage

About

Track changes to titles in NOS articles

twitter.com/nosedits

Topics

journalismnosnoseditsopentitles

Resources

Readme
MIT license
Activity

Stars

16 stars

Watchers

0 watching

Forks

1 fork
Report repository

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.