• Stars
    star
    156
  • Rank 231,242 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created over 3 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

Larry 🐦 is a bot generator that post content from different providers to one or multiple publishers

Larry 🐦

Go Coverage Status Go Report Card MIT License Contribute with Gitpod

Larry is a Golang cli bot that tweets random Github repositories.

Disclaimer

I hold no liability for what you do with this bot or what happens to you by using this bot. Abusing this bot can get you banned from Twitter, so make sure to read up on proper usage of the Twitter API.

Running bots

  • GolangRepos: Tweets repositories from Github that contain the "golang" topic
  • RustRepos: Tweets repositories from Github that contain the "rust" topic
  • MLRepositories: Tweets repositories from Github that contain the "machine-learning" topic
  • CryptoRepos: Tweets repositories from Github that contain the "crypto" topic

Installation

You can install Larry by cloning the repo and using go install

git clone https://github.com/ezeoleaf/larry.git
cd larry/cmd/larry
go install

You can also use make for building the project and generating an executable:

git clone https://github.com/ezeoleaf/larry.git
cd larry
make build

Or you can just run it on the go

git clone https://github.com/ezeoleaf/larry.git
cd larry
go run . [options]

Usage

Configuring the bot

Before running the bot, you must first set it up so it can connect to Github and the publisher's API.

To do this, you will need to setup the following environment variables:

  • GITHUB_ACCESS_TOKEN

For generating Github access token you can follow this guide

Providers and Publishers

For information on publishers and providers click here

Running the bot

To run the bot, you have two ways.

If you have installed the bot, you can run it using larry [options]

If you want to run it without installing it globally you can use go run . [options]

Example:

larry -h

As a response you will see the entire options available

NAME:
   Larry - Bot that publishes information from providers to different publishers

USAGE:
   larry [global options] command [command options] [arguments...]

AUTHORS:
   @ezeoleaf <[email protected]>
   @beesaferoot <[email protected]>
   @shubhcoder
   @kannav02
   @siddhant-k-code <[email protected]>
   @savagedev

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --topic value, -t value          topic for searching repos
   --lang value, -l value           language for searching repos
   --time value, -x value           periodicity of tweet in minutes (default: 15)
   --cache value, -r value          size of cache for no repeating repositories (default: 50)
   --hashtag value, --ht value      list of comma separated hashtags
   --tweet-language, --tl           bool for allowing twetting the language of the repo (default: false)
   --safe-mode, --sf                bool for safe mode. If safe mode is enabled, no repository is published (default: false)
   --provider value, --pr value     provider where publishable content comes from (default: "github")
   --publisher value, --pub value   list of comma separated publishers (default: "twitter")
   --content-file value, --cf value file containing content to publish
   --skip-csv-header, --sh          bool to skip CSV file header. If true, then first record of CSV file is skipped (default: false)
   --blacklist value, --bl value    optional file containing blacklisted repository Ids
   --help, -h                       show help (default: false)

For running the bot, the command will depend on whatever you want to tweet, but, for tweeting about React repositories every 30 minutes, you could use

  larry --topic react --time 30 --safe-mode

For running the bot for Rust tweets every 15 minutes

  larry --lang rust --time 15

For running the bot for Golang every 15 minutes and specifying a blacklist file named blacklist.txt

  larry --topic golang --time 15 --blacklist ./blacklist.txt

For running the bot every 60 minutes using the "contentfile" provider and JSON file for content

  larry --time 60 --provider contentfile --content-file ./content.json

For running the bot every 60 minutes using the "contentfile" provider to read CSV file for content and skipping the header record

  larry --time 60 --provider contentfile --content-file ./content.csv --skip-csv-header

Content Files

The contentfile provider serves content from CSV and JSON files.

JSON Content File

When the contentfile provider receives a content-file filename with a .json extension, the provider serves random content from the JSON file. This file consists of an array of objects in the following format. ExtraData is an array of strings.

[{
   "Title": "larry",
   "Subtitle": "Larry 🐦 is a bot generator that publishes random content from different providers built in Go",
   "URL": "github.com/ezeoleaf/larry",
   "ExtraData": ["68", "ezeoleaf", "golang"]
}]

CSV Content File

When the contentfile provider receives a content-file filename with a .csv extension, the provider serves random content from the CSV file. Each field may or may not be enclosed in double quotes. The ExtraData strings start at field 4 of the record and a record can contain any number of elements.

The following file has one record with three ExtraData strings.

The title,The subtitle,URL,ExtraString1,"ExtraString2,has comma",ExtraString3

An example CSV file with a header record followed by one record:

Title,Subtitle,URL,Stars,Author,Language,ExtraData1,ExtraData2,ExtraData3
larry,Larry 🐦 is a bot generator that publishes random content from different providers built in Go,github.com/ezeoleaf/larry,68,ezeoleaf,golang

Note: Every record in the CSV file, including the header record, must have the same number of fields otherwise an error will occur. This means if the records will have a variable number of ExtraData fields, each record having fewer than the maximum ExtraData fields must include empty ExtraData fields to match the maximum.

Blacklist File

Github Provider

For the github provider, the optional blacklist file consists of numeric GitHub repository IDs to exclude from the publishing process. These IDs can be found on the GitHub repository page source in the meta tag octolytics-dimension-repository_id.

An example blacklist file containing GitHub repository IDs. The file can contain comments using the # character, everything on the line after this character is ignored.

# Blacklisted repositories
123 # description of the respository
456

Contentfile Provider

For the contentfile provider, the optional blacklist file consists of content titles to exclude from the publishing process.

Have questions? Need help with the bot?

If you're having issues with or have questions about the bot, file an issue in this repository so anyone can get back to you.

Or feel free to contact me [email protected] :)

Star History

Star History Chart

ko-fi

More Repositories

1

tblogs

A simple and useful blogs' reader for your terminal
Go
39
star
2

awesome-golang-repositories

List of the repositories published by Larry
13
star
3

snitch

Snitch is a Slack bot that fetches pending review PRs built in Go
Go
7
star
4

printThis.js

PrintThis.js let you print the content with the class printThis
HTML
2
star
5

PechaKucha-NoSQL

Presentation of Big Data and NoSQL in PechaKucha format
JavaScript
2
star
6

MazeHunter-Eof

HTML
1
star
7

1hh0-Eof

1hh0 Game - jQuery, HTML, CSS
JavaScript
1
star
8

RobotWar-Eof

RobotWar Game
JavaScript
1
star
9

go-life

Conway's Game of Life implemented in Golang
Go
1
star
10

go-passgen

Password generator built in Go
Go
1
star
11

f1-go-turtle

F1 circuit generator in Golang
1
star
12

ATNYW

1
star
13

go-warmup

WarmUp Generate in Golang
Go
1
star
14

PassGenerator-Eof

JFF PassGenerator
JavaScript
1
star
15

RobotRace-Eof

Game of race of tanks
CSS
1
star
16

ezeoleaf-hugo

Personal page built with Hugo
1
star
17

ExtJs6-Example

Example of ExtJs6 - Grids and Graphics
JavaScript
1
star
18

food-by-eze

My cookbook
CSS
1
star
19

2048-Eof

2048 Game
HTML
1
star
20

SistAlCec-Eof

JavaScript
1
star
21

ezeoleaf

1
star
22

ezeoleaf.github.io

HTML
1
star
23

Pong-Eof

Pong Game
JavaScript
1
star
24

book-search

HTML
1
star
25

advent-code-algorithms

Algorithms for [Advent of Code](https://adventofcode.com/) in Golang
Go
1
star
26

CoordinatesGenerator

Geographic Coordinates Generator based on a geo-fence
JavaScript
1
star
27

GeekLoader

Add a lot of 8 bit characters to replace the loader in your website
JavaScript
1
star
28

Sudoku-Eof

Sudoku Game
JavaScript
1
star
29

Cryptor-Eof

Cryptor encrypts and disencrypt text with homemade encryption methods
JavaScript
1
star
30

Snake-Eof

Snake Game
JavaScript
1
star
31

Android-Examples

Ejemplos en Android
Java
1
star
32

libreriaCiudadProvincia-Eof

Shows a city according to a selected province without checking the database
JavaScript
1
star
33

BreakOut-Eof

Breakout Game
JavaScript
1
star
34

gobot

Twitter bot in Golang
1
star
35

bankverification

Swedish bank account validation
Go
1
star
36

watch-this

Series and Movies recommendation made in Golang
Go
1
star
37

mc

MC
Go
1
star
38

Minesweeper-Eof

Minesweeper Game
JavaScript
1
star
39

Tileset-Eof

Recopilation of tilesets
1
star
40

8BeerTender-Eof

BeerTender Game - 8 bit
JavaScript
1
star
41

SudokuGenerator

SudokuGenerator Jquery/Javascript
JavaScript
1
star