Skip to content

Instantly share code, notes, and snippets.

@bryanwoods
Created December 29, 2008 00:34
Show Gist options
  • Save bryanwoods/41109 to your computer and use it in GitHub Desktop.
Save bryanwoods/41109 to your computer and use it in GitHub Desktop.
# memerator.rb
# Script for making static YES/NO meme websites
# For fun and profit
#
# Bryan Woods
# http://snuggietonight.com
#
# HOWTO:
# 1. Buy Clever Domain Name
# 2. Edit the "Customization" section of this script (Lines 17-22)
# 3. Run script ($ ruby memerator.rb )
# 4. There is no step 4
require 'net/ftp'
# Customization
site_title = 'Should I Wear a Snuggie Tonight?'
site_decision = 'YES' # Choose YES or NO
ftp_address = 'snuggietonight.com'
ftp_username = 'iluvsnuggies'
ftp_password = 'p455wr0d'
ftp_directory = 'public_html/snuggietonight'
# Create the HTML page with customizations
page = (
"<html><head><title>" + site_title + " </title>
<style>* { text-align: center; font-family: Verdana,
Arial, Helvetica, sans-serif; font-size: 120px;
font-weight: bold; padding-top: 50px; }</style>
</head><body>" + site_decision +"<br /><br /></body>
</html>" )
file = File.new("index.html", "w" )
File.open("index.html","w") do |f|
f.puts page
end
# Connect to the ftp server and upload the HTML file
ftp = Net::FTP.new(ftp_address)
ftp.login( username=(ftp_username), password=(ftp_password))
ftp.chdir(ftp_directory)
ftp.puttextfile('index.html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment