hustlr
hustlr copied to clipboard
A web app for HN hustlers
Hustlr: The Web App that Names Your Startup
A Flask webapp with a Mongo backend that will generate a name of a startup based on Hacker News.
To see it in action, go here.
About
This webapp serves the code needed to generate your own Hacker News startup name.
Underlying Business Logic
# Import Python HN API and Pyphen
from hackernews import HackerNews
import pyphen
import random
from itertools import chain
# Generate dictionary
dic = pyphen.Pyphen(lang='en')
# Generate HN
hn = HackerNews()
# Get top 50 Stories
top_stories = hn.top_stories(limit=50)
# Get individual words in titles
words = [title for story in top_stories for title in story.title.strip("'").strip(",").split(' ')]
# Get syllables per word
syllables = [syllable for word in words if not word.islower() and not word.isupper() for syllable in dic.inserted(word).split("-") ]
# Generate mixed list of syllables
mixed_bag = [syllable for syllable in syllables if len(syllables) > 1]
print("***Congrats on your new startup:***")
print(f"{random.choice(mixed_bag).upper()}{random.choice(mixed_bag).upper()}")
To Build Locally:
- Clone repo
- Install
Mongo
,Python3
,Docker
, andDocker-Compose
. - CD into the repo.
- Run
docker-compose build
- Run
docker-compose up
- Navigate to
localhost
on your browser.