Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Twitter bot which tweets Magic cards with appropriate GIFs superimposed (github.com)
138 points by minimaxir on Oct 12, 2017 | hide | past | web | favorite | 38 comments

This is awesome.

Side note: I absolutely despite how Twitter bakes all GIFs into videos and prevents you from saving them as GIFs.

When there's a gif in a discussion, it's like 3 taps on mobile to play it despite having a play icon on it. First time you touch it, it just expands the tweet. Then it expands the video. Then it actually plays the video.

Hilariously bad ui.

You say "bad UI," twitter says "increased engagement!"

Potato, potahto.

I know you're joking but that's still a bullshit metric and a risky one to make if they are looking at only taps + total time. It's not increasing ad revenue, extending meaningful engagement time, or user happiness.

Having worked in analytics for a long time I've seen countless examples of metrics like these being needlessly optimized so I find it harder to laugh at.

GIF is basically a bad file format, which is why people will use anything else

Twitter doesn't let you save the video neither.

One (cumbersome) way of saving the video is to open the tweet and prefix it with m. e.g https://m.twitter.com/github/status/917527674163167233 and then download video.

youtube-dl link to tweet from your terminal

That always results in desynced A/V whenever I try it.

Usually lots of errors like the following from ffmpeg, then the audio is about a second behind the video

[mp4 @ 0x98668b4620] Non-monotonous DTS in output stream 0:1; previous: 132227, current: 131204; changing to 132228. This may result in incorrect timestamps in the output file.

Shift+Right Click on Firefox should work.

Incidentally, the output and uploaded file is a video, because there's no point in saving it as a GIF since it'll be baked into a video anyways.

Not only that, the interface makes it impossible to see even images at actual size unless you use the DOM inspector. For large images with small text this is unusable.

(I also resent websites which put transparent divs over images or videos to prevent Save-As, but this is really widespread)

> (I also resent websites which put transparent divs over images or videos to prevent Save-As, but this is really widespread)

I agree. Did anyone write an extension that lets you click on an image, and which would then dig down through the DOM and find its actual source? I'm considering learning how to write browser extensions just to make that.

Isn't that what HoverZoom is made for?

Ah, that certainly seems to do what I want for Twitter, thanks!

There's a not on the Github page, where he mentions that he doesn't uses GIF but video's. The files generated are actually videos, not proper GIFs. Videos are created much faster, take less disk space, and on Twitter, functionally identical to GIFs (videos less than 6 seconds will also autoloop).

That's pretty amazing. Too bad we can't print GIFs. Will this lead to a resurgence of "MTGIF" or "Magic: The GIFering"?

(And all this time, I've been doing it manually with Imgur images and MTGCardMaker.com. Tangentially, here is an album of MTG cards I made to try and "port" common Powershell functions to MTG: https://imgur.com/a/4sa6v)

http://gifpop.io/ does a pretty good job using lenticular printing.

Well, you can (technically) print GIFs..


> Too bad we can't print GIFs.

This is the best approximation I've seen: https://www.giphoscope.com/

Invite webrequest at cmc1 is pretty OP! :)

"Too bad we can't print GIFs."

Gonna call it now - physical digital trading cards, animated.

No, no. Not even close.

Very interesting project, integrating all these different libraries. One thing, I noticed that you are using a hardcoded path to the json. Created an issue for you https://github.com/minimaxir/magic-the-gifening/issues/2. Thanks for sharing your work.

Another slightly related cool twitter bot is @RoboRosewater, that uses machine learning to generate new cards.


I don't understand... where is it pulling the GIFs from? How does it determine what GIF to use for a given card?

The code is pretty short and easy to read:

It parses the card names and IDs from a CSV file here:


And calls create_mtg_gif, which calls get_giphy_gif, which requests GIFs from the giphy API by searching for the card name, and then finds one that has an appropriate aspect ratio.


Specifically, the GIPHY Random endpoint, which takes in a tag as a parameter: https://developers.giphy.com/docs/

I can't believe it's 2017 and Twitter still doesn't have a "Top Tweets" link in every profile to sort tweets by popularity (RT+likes count)

Twitter is a complete mess, UX-wise. I don't know what they're doing over there.

Probably a continuous fight between progessive and conservative UX designers. Just like the US basically.

Haha does that mean that "prog" and "cons" designers actually have basically identical tastes, and fixate on tiny insignificant differences while ignoring a whole universe of design possibility? That would explain how fast Twitter gets new things out the door...

That would imply at least someone within the company understands how people use the product.

That's hard to believe.

I wouldn't like that. What I like about Twitter is that, for the most part, digging in old tweets is hard.

Actually one just have to press the "end" key a few times and you quickly display all tweets of a single person, just not sorted.

Anyway, this feature its missing for the time-less accounts (e.g not time-sensitive tweets), such as the one featured in this project and other ones like @AwardsDarwin @DeviantArt, @greatestquotes

I don't understand how I sometimes can see replies to tweets and sometimes get prompted with signing in when I click the comments icon.

Too bad it barely works.

I like the idea though.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact