#twitter

Sunday project: Huginn, Docker & Ansible

Some time ago I set up a #Twitter account posting #WWII "as it happened" events to #Socialhome (see here). This was accomplished using Zapier that reads the tweets and then POST's to the Socialhome API.

All that worked great and #Zapier is really nice. Except it's limited to 100 events per month on the free tier and this seems wasn't enough for the WWII tweets coming in. Zapier paid plans are from $20/mo which is way too much just to replicate some tweets.

At first I thought about making my own app to do all this but then I remembered running into Huginn, which I have been wanting to install anyway. It's basically a self-hosted #IFTT or Zapier, but allowing for even more complex stuff like unlimited chaining of events.

Docker + Ansible

I'm pretty new to #Docker but eventually I want to dockerize more of my apps. So of course I was happy to see #Huginn has a Docker image, allowing me to not have to muck about with any more #RoR apps. I use #Ansible for pretty much everything, so it made sense to build a playbook to deploy the app in a Docker container.

Luckily (or thanks to the fantastic Ansible team that is!), maintaining Docker containers with Ansible is as easy as doing anything else with it.

I chose to keep the web server out of the containers to use my standard #LetsEncrypt role for getting SSL on top. This made the role very simple, having only to 1) fetch SSL cert, 2) set up Apache to proxy and 3) push up a container.

The docker_container Ansible module call is basically just this:

 ---
 - docker_container:
   name: huginn
   image: huginn/huginn
   volumes:
     - "{{ huginn_db_volume_mount }}:/var/lib/mysql"
   env:
     APP_SECRET_TOKEN: "{{ huginn_secret }}"
     DOMAIN: "{{ huginn_domain }}"
     FORCE_SSL: "{{ huginn_https}}"
     INVITATION_CODE: "{{ huginn_invitation_code }}"
     MAIL_FROM_ADDRESS: "{{ huginn_mail_from }}"
     RAILS_ENV: production
     SMTP_DOMAIN: "{{ huginn_smtp_domain }}"
     SMTP_PASSWORD: "{{ huginn_smtp_password }}"
     SMTP_PORT: "{{ huginn_smtp_port }}"
     SMTP_SERVER: "{{ huginn_smtp_server }}"
     SMTP_USER_NAME: "{{ huginn_smtp_username }}"
     TWITTER_OAUTH_KEY: "{{ huginn_twitter_key }}"
     TWITTER_OAUTH_SECRET: "{{ huginn_twitter_secret }}"
   register: _docker_huginn

The container IP is then picked up from _docker_huginn by Apache to do the proxying.

The playbook itself, without any extra customization is pretty much here:

 ---
 - hosts: myhost
   become: yes
   become_user: root

   vars:
     letsencrypt_email: youremail@example.com
     huginn_domain: huginn.example.com
     huginn_invitation_code: changeme!
     huginn_secret: changeme!

   roles:
     - huginn

The result is the ansible-huginn role. Tested on #Ubuntu 14.04. Right now a bit limited in terms of configuration that can be passed in. Will expand as necessary.

Fun Huginn stuff

Some initial things I want to do is to use the chaining to make the tweet replicating not embed the tweet, but instead rip out the text + media and create a normal post instead. That should make for cleaner streams with less Twitter JS firing off.

Any tips on fun stuff to do with Huginn?

huginn/huginn
huginn - Create agents that monitor and act on your behalf. Your agents are standing by!

Jason Robinson

#StephenCurry would not be the first time #trump rushes to #twitter - even from his private jet - to save face by lying about what happened

Dr. Roy Schestowitz (罗伊)

Actually, upon further recollection, it probably wasn't Vogels who said he had left because of #kohl on #twitter

It was someone else.

Dr. Roy Schestowitz (罗伊)

This is why I keep recommend #Jabber and #XMPP


Avatar @{matt ; @matt@cybre.space} <sup> 23.9.2017, 04:17</sup>

> 1996: do you have email?

> 1997: do you have icq?

> 1998: do you have paltalk?

> 1999: do you have aim?

> 2000: do you have msn messenger?

> 2001: do you have yahoo messenger?

> 2003: do you have skype?

> 2004: do you have myspace?

> 2005: do you have facebook?

> 2007: do you have twitter?

> 2008: do you have instagram?

> 2010: do you have kik?

> 2011: do you have google talk?

> 2012: do you have facebook? (again)

> 2015: do you have discord?

> 2020: do you have email?

> 2025: do you have a telephone?

> 2030: do you have any water?

via Mastodon : https://cybre.space/@matt/3854614

<sub>via @{Jason Robinson ; jaywink@jasonrobinson.me} via @{dada ; dadall@diaspote.org}<br></sub>


What I am using:

What I used (and probably accounts exist):

What I refuse(d) to use:

What I never heared about:

Whats left?

  • #googletalk well, I am using XMPP and I used it with #gtalk and #gmail users... so I am no direct customer but I do communicate to those. As I send emails to gmail accounts (if I can encrypt them)
  • #discord - once it was verry close I used to use this. I had it installed but I didn't create an account. And then the reason I needed this disapeared so I didn't really use it XD

How about you?

#msnmessenger #yahoomessenger

Deus Figendi

#AmandaMartin on #Twitter: "La reforma educativa para 2018 no está prevista aplicación en escuelas privadas. A laburar gratis en la escuela pública, de eso se trata."https://twitter.com/amandamartinok/status/909061340060356608 <br>

<sub>via Diaspora* Publisher -</sub>

#ReformaEducativa #ReformaAntiEducativa #CABA #Macri #GBA #BuenosAires #Argentina #Educación #privatización #precarización #súper-explotación #manodeobra #educaciónpública #escuelas #escuelapública #pasantías


riveravaldez

#twitter is nowadays giving the finger to anyone (users) who does not use one of the "big " (usually proprietary) Web browsers. Appalling.

Dr. Roy Schestowitz (罗伊)

#twitter appears to have just broken - probably unintentionally - compatibility with #qupzilla aka #flakon

They prop up monopolies.

Dr. Roy Schestowitz (罗伊)

A few days ago #twitter made some changes that effectively broke the site for highlighting of users if you use #qupzilla aka #falkan

F*!

Dr. Roy Schestowitz (罗伊)

Donald Trump Keeps Getting Manipulated By Twitter Bots https://youtu.be/fY5HqSw82C4 via @YouTube #POTUS #USA #Trump #Twitter

"Donald Trump loves Twitter, but he also apparently loves to retweet fake accounts that have been set up to promote his presidency. Once again, it looks like the President has been retweeting fake Twitter bots in an attempt to show how much people love and support him. Ring of Fire’s Farron Cousins explains why this isn’t as harmless as it may seem."

Donald Trump Keeps Getting Manipulated By Twitter Bots
Donald Trump loves Twitter, but he also apparently loves to retweet fake accounts that have been set up to promote his presidency. Once again, it looks like ...

neptune33

#twitter tires very hard to keep its #censorship covert/secret, but sometimes people notice (oops!) https://twitter.com/ProvidenceAve/status/910282948678647808


Dr. Roy Schestowitz (罗伊)

My #twitter account is under attack. Today alone there were 4 attempts to hijack it.

Dr. Roy Schestowitz (罗伊)

#joinDiaspora has just fixed the #twitter 'bridge' I reckon #twitterCensorship will be attempted again soon.

#censorship #internet

Dr. Roy Schestowitz (罗伊)