Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

csnyder616/hn_ideator

Repository files navigation

Logo: white lightbulb on HN orange Show HN: hn_ideator

A beautiful, highly opinionated project headline generator written in Ruby.

Twitter logo Follow the bot on Twitter

Anyone who regularly visits Hacker News has seen the "Show HN: {proper noun} — a[n] {adjective} {noun} written in {trendy language}” headlines. Inspired by a HN comment surmising that all HN project descriptions are really written by Markov chains, I decided to write a Twitter bot that generates “Show HN”-style headlines.

Approach

Since this bot generates headlines (rather than the longer project descriptions the original author described), I decided that a Madlib-style approach would be appropriate. It follows the following pattern:

Show HN: {proper noun} — a[n] [{adverb}] {adjective} {noun}, [{adverb}] {verb} in {language}

{proper noun}

The goal here was to create a new “word” to describe the project:

  1. Word length picked at random
  2. Random characters are selected; the random character picker biases towards consonants or vowels based on the previous character
  3. Capitalize the first letter, as well as other characters at random for CamelCasing
  4. Occasionally add a trendy suffix like .ly, Box, etc.

{adverb}s, {adjective} and {noun}

Uses WordNet to get random characters from the needed part of speech, using indefinite_article to add the article before the adverb or adjective

{verb}

Right now, it just picks from a pre-determined list. I tried to use WordNet to get synonyms (or words from the same domain as "written"), but I couldn't figure out how to get results that made any semblance of sense.

{language}

Picks a language at random from the included langs.txt. The languages were scraped (see the included prog_languages script) from the Wikipedia listings for serious and esoteric programming languages.

Twitter

When called with the "post" command-line argument, the generated headline will be posted to Twitter. This requires Twitter API access and user authorization.

Copyright

Copyright 2015 Chris Snyder, released under the MIT license.

About

“Show HN” Ideator Bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages