Bro Txt

So one of my bros posted something on my Facebook wall recently:

Make me an app that sends you txts regularly that say things like: “dumbass” or “idiot”…

Of course, bothering your engineering bro in such a manner means that he will do your bidding wholeheartedly and willingly. But whoops, I entered his number instead of mine! Oh no! How will I know that I’m a dumbass and an idiot?? I will fail to become a better person, and be forever alone.

However, it would be such a shame to not use this wonderful specimen of an application. Mayhaps, you would be interested in letting a certain someone know that they are, say, a horrid oaf?

If you are, you can do so here.

Get in on it while my Twilio account still has money in it! Please don’t send too many: I would rather not get rate-limited and have the Twilio developers be mad at me :'(

A slightly better writeup to come (really, this was a 1.4-night fling. Documentation? What documentation?)

So a bit more documentation here! I’ve also shut down the backend powering this thing, because my bro doesn’t have an unlimited number of texts. However, you can still play around with the frontend and pretend texts are still being sent.


Pretty much just “stole” this code for the “backend” portion of the app, bought a number from Twilio (you can’t pull this off with just a trial session, but upgrading isn’t difficult, and I pulled this app off without spending any money), and made the rest with HTML/Javascript using anti-best practices (because when you have one stinking HTML file, it doesn’t matter if you have a separate stylesheet or not. Really). Since you guys have all the source (HTML/JS are all downloadable) and the single PHP file is essentially the first tutorial, you don’t need a discrete download. Really, you don’t.

Well, I guess I should point out what might be the only useful part of the project: viewing the frontend page on different devices yields font sizes that approximately fill the width of the screen in a visually consistent way. To spare you a dig through the HTML file (oh no! Thank you for saving us all!) I used the decidedly non-linear equation to give me a font pixel size, which I applied to body:

width/90 + 2.5*height/width

Generally, this says the wider the screen is, the bigger the base font should be, but if the screen is also long and skinny (lookin’ at you smartphones), then that also sizes up the font. It works well empirically, okay?


And because I am a geek, we have to do analysis!

Overall, 45 texts were sent in the name of science (maybe not). There was a 3-way tie between “Dumbass”, “Retard” and the surprising “Nitwit”, with each getting 5 texts, and a tied 2nd place for “Moron” and “Simpleton”. Surprisingly, “Idiot” was only sent once, as was (not so surprisingly) “Fool”. The variance in the “ghetto” words was surprisingly low, with each one taking 2 or 3 texts, possibly because they did not describe my bro in adequate detail. You know what, just look at the chart:

What can we conclude from this? Absolutely nothing, except that my brother might be a nitwit. Hey, just sayin’