0xDEADBEEF

RSS odkazy

hypertweeter

14. 9. 2020, aktualizováno: 3. 3. 2021 #kód

Humane twitter client, version 6 (Source)


Running from the fat jar file:

wget https://deadbeef.k47.cz/t/tw.jar
java -jar tw.jar

Running from the Scala source

wget -nc https://repo1.maven.org/maven2/org/twitter4j/twitter4j-core/4.0.7/twitter4j-core-4.0.7.jar
wget -nc https://repo1.maven.org/maven2/org/typelevel/jawn-parser_2.13/1.0.0/jawn-parser_2.13-1.0.0.jar
wget https://deadbeef.k47.cz/t/tw.scala

scala -cp './*' tw.scala

(Java 8 and Scala 2.13 required).


Export your tweets and likes: java -jar tw.jar export

Delete all tweets and likes older than certain number of days: java -jar tw.jar purge 14

Run in offline mode without background updates: java -jar tw.jar offline

Display daily activity of your followers (buildAntiTimeline is required to collect necessary data): java -jar tw.jar activity


Even if you run the program form the jar file, it's still possible to configure and customize it. First create a Scala script run.scala with all your configuration and pass it to the Hypertweeter.startClient method as follows:

import Hypertweeter._

startClient(new Config {
  // gray out all tweets from, mentioning, quoting or retweeting certain users
  override def grayoutTweet(t: Status): Boolean = {
    val users = relevantUsers(t)
    users.contains("GonzoCharacters")
  }

  // hide tweets mentioning certail words
  override def hideTweet(t: Status): Boolean = {
    val txt = rawTweetText(t).toLowerCase
    txt.matches("bitcoin|btc|cryptocurrency|little horses")
  }

  // mix some more users into your timelime which you not follow on the size
  override def followUsers = Seq("kaja47")

  // mix in some RSS or Atom feed for good measure
  override def rssFeeds = Seq(
    "https://deadbeef.k47.cz/rss.xml",
    "https://k47.cz/rss.xml",
  )

  // Collect timelines from people who follows you.
  // It's available on url /anti
  def buildAntiTimeline = true

  // path where OCR program tesseract is installed
  override def ocrProgram = "/home/hyperboy/bin/tesseract"
})

Now run hypertweeter as follows:

scala -cp tw.jar run.scala
píše k47 (@kaja47, k47)