DockerCuties

command module
v0.0.0-...-1ae2363 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2019 License: MIT Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

DockerCuties

Build Status

Post pictures of cute animals from Docker's pull requests to twitter.

Example

Collection of cuties from Docker pull requests on Twitter https://twitter.com/DockerCuties

Usage

Access tokens

To use this project you need credentials for accessing:

Add a file called TOKENS to your project. The format of this file should be:

twitterConsumerKey = <Twitter consumer key>
twitterConsumerSecret = <Twitter consumer secret>
twitterAccessToken = <Twitter access token>
twitterAccessSecret = <Twitter access token secret>
githubPersonalAccessToken = <Github personal access token>

Docker image

Create image from Dockerfile with tag cuteimage:

$ docker build -t cuteimage github.com/lelenanam/DockerCuties

Docker container

To check already running containers on the system use command:

$ docker ps

If there is previously ran container cuteiner, remove it:

$ docker rm -f cuteiner

Create and start a container in background (-d) from image cuteimage. Bind mount volume TOKENS, assign the name cuteiner to the container. To change log level use parameter app --loglevel

$ docker run -v $(pwd)/TOKENS:/go/src/app/TOKENS -d --name=cuteiner cuteimage --loglevel=info

Now you should see your cuteiner listed in the output for the docker ps command.

CONTAINER ID      IMAGE       COMMAND                  CREATED             STATUS           PORTS      NAMES
c111efc69db3      cuteimage   "app --loglevel=info"    14 seconds ago      Up 14 seconds               cuteiner

To fetch the logs of the container:

$ docker logs -f cuteiner

Project Description

  • Traverse all pull requests in Docker repository on Github and look for links in pull request body. The pull requests can be retrieved page by page.
  • After the link is found try to get an image from URL.
  • Check if the image is the screenshot. Don't post the screenshot and skip it.
  • If the image is a picture, check the size of it because there is a twitter limit for media upload. Resize an image if needed.
  • Encode image to string.
  • Before posting new tweet we need to check the number of last posted pull request. Check most recent twitter timeline and find the largest number of posted pull request.
  • If there is no link in pull request just skip it. Otherwise, post it to twitter.
  • Update twitter every 60 seconds for new cuties.
  • There is a notification about screenshots and errors. There will be the direct message to twitter about it.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL