https://github.com/piotrjustyna/fontbot
Choose word, choose font, tweet. Twitter bot written in Haskell.
https://github.com/piotrjustyna/fontbot
font haskell regular-expression timeline tweets twitter
Last synced: 2 months ago
JSON representation
Choose word, choose font, tweet. Twitter bot written in Haskell.
- Host: GitHub
- URL: https://github.com/piotrjustyna/fontbot
- Owner: PiotrJustyna
- License: bsd-3-clause
- Created: 2016-06-19T15:35:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-07T20:55:38.000Z (about 9 years ago)
- Last Synced: 2025-01-11T16:38:56.277Z (9 months ago)
- Topics: font, haskell, regular-expression, timeline, tweets, twitter
- Language: Haskell
- Homepage: https://twitter.com/HaskellFontbot
- Size: 4 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fontbot
Choose word, choose font, tweet.
| Algorithm | Example |
| --- | --- |
|  |  |# log
## 2016-07-16
Closed all remaining issues, fontbot is ready to deploy.

## 2016-07-12
Choosing random font:
```bash
C:\Users\Piotr\Documents\fontbot>stack exec fontbot-exe
found 33 fonts
randomly chosen font: Cantarell-Bold.ttfC:\Users\Piotr\Documents\fontbot>stack exec fontbot-exe
found 33 fonts
randomly chosen font: Cantarell-Bold.ttfC:\Users\Piotr\Documents\fontbot>stack exec fontbot-exe
found 33 fonts
randomly chosen font: LearningCurve_OT.ttfC:\Users\Piotr\Documents\fontbot>stack exec fontbot-exe
found 33 fonts
randomly chosen font: Quicksand-Italic.ttfC:\Users\Piotr\Documents\fontbot>stack exec fontbot-exe
found 33 fonts
randomly chosen font: Exo-SemiBold.ttfC:\Users\Piotr\Documents\fontbot>stack exec fontbot-exe
found 33 fonts
randomly chosen font: Quicksand-BoldItalic.ttfC:\Users\Piotr\Documents\fontbot>stack exec fontbot-exe
found 33 fonts
randomly chosen font: Quicksand-Bold.ttf
```Full process implemented:

## 2016-07-09
Interesting changes today:
* slightly changed tweet search keyword - "a" produces much more random results
* cleaned up retrieved interesting words
* chained the tweet-generating functions together:
* tweet retrieval
* font preview generation
* tweetingNow, when executed, the fontbot grabs the first interesting word out of a batch of retrieved tweets, generates the image (fixed font) and tweets it.

## 2016-07-07
Playing with (very simple) regular expressions and extracting potentially interesting words:
```bash
search metadata:
- query: "Haskell"
status:
"This must be a canonical choice among isomorphic objects."
first interesting word:
canonical
```## 2017-07-06
I added more fonts and think I'm finally happy with the media size and text positioning:

## 2016-07-05
Playing with regular expressions:
```bash
search metadata:
- query: "Haskell"
raw status:
"Win a copy of James Haskell: RugbyFit https://t.co/rh3q5CiXgG"
filtered status:
James
---
raw status:
"The recent watercolor paintings of Ann Jones will be on display at the Hall Haskell House Gallery in Ipswich. .... https://t.co/Vd1E6HG7y6"
filtered status:
paintings
---
raw status:
"RT @joshuaclayton: Three months into learning #haskell with @haskellbook! Wrote up how to refactor to a monad transformer stack: https://t.\8230"
filtered status:
months
---
```## 2016-07-03
Fontbot can now render text to images.


## 2016-07-02
Fontbot can now read and process twitter search results:
```bash
$ stack exec fontbot-exe
search metadata:
- query: "Haskell"
status:
"RT @notsleeeping: @TVG American Freedom looked good! Baffert might have his Haskell horse, going for #9, & for 6 wins in the last 7 Haskell\8230"
---
status:
"RT @Steve_Byk: @DRFHersh @EaSyGoEr53 As of tonight, Baffert leaning American Freedom to Haskell, Arrogate toward Travers."
---
status:
"Vintage Miriam Haskell signed double chain necklace Russian gold gilt pendant https://t.co/Pxrt595goI https://t.co/q6VyXN9XCW"
---```
## 2016-07-01
Once the POC tweeting mechanism was ready, I decided not to reinvent the wheel going further and to use the twitter-conduit.
[Sample Tweet](https://twitter.com/HaskellFontbot/status/748962791961296896)
## 2016-06-28
Fontbot can now tweet using manually prepared OAuth signature read from external file.
```yaml
C:\Users\Piotr\Documents\fontbot>stack exec fontbot-exe
is_quote_status: false
in_reply_to_status_id: null
id_str: '747879477645049856'
truncated: false
in_reply_to_screen_name: null
entities:
symbols: []
urls: []
user_mentions: []
hashtags: []
text: Hello World From Haskell with OAuth header value taken from external file!
in_reply_to_user_id_str: null
favorited: false
coordinates: null
retweeted: false
user:
screen_name: HaskellFontbot
is_translation_enabled: false
default_profile: false
profile_image_url: http://pbs.twimg.com/profile_images/747072074280243200/QWq406SC_normal.jpg
default_profile_image: false
id_str: '747071344764923904'
profile_background_image_url_https: https://abs.twimg.com/images/themes/theme1/bg.png
protected: false
location: Dublin City, Ireland
entities:
url:
urls:
- expanded_url: https://github.com/PiotrJustyna/fontbot
url: https://t.co/2tFkSIdL6B
indices:
- 0
- 23
display_url: github.com/PiotrJustyna/f
description:
urls: []
profile_background_color: '000000'
utc_offset: null
url: https://t.co/2tFkSIdL6B
profile_text_color: '000000'
profile_image_url_https: https://pbs.twimg.com/profile_images/747072074280243200/QWq406SC_normal.jpg
verified: false
statuses_count: 3
profile_background_tile: false
following: false
lang: en
follow_request_sent: false
profile_sidebar_fill_color: '000000'
time_zone: null
name: fontbot
profile_sidebar_border_color: '000000'
geo_enabled: false
listed_count: 0
contributors_enabled: false
created_at: Sun Jun 26 14:17:43 +0000 2016
id: 747071344764923904
friends_count: 1
is_translator: false
favourites_count: 0
notifications: false
profile_background_image_url: http://abs.twimg.com/images/themes/theme1/bg.png
profile_use_background_image: false
description: Choose word, choose font, tweet.
has_extended_profile: false
profile_link_color: '000000'
followers_count: 1
lang: en
retweet_count: 0
in_reply_to_user_id: null
created_at: Tue Jun 28 19:48:57 +0000 2016
source: fontbot
geo: null
id: 747879477645049856
in_reply_to_status_id_str: null
favorite_count: 0
contributors: null
place: null
```