Skip to content

Instantly share code, notes, and snippets.

brianburridge / ruby_ftp_example.rb
Last active August 30, 2019 14:46 — forked from 3dd13/ruby_ftp_example.rb
Sample code of using Ruby Net::FTP library. Login to FTP server, list out files, check directory existence, upload files
require 'net/ftp'
CONTENT_SERVER_FTP_LOGIN = "saucy-ftp-server-login"
CONTENT_SERVER_FTP_PASSWORD = "saucy-ftp-server-password"
# LOGIN and LIST available files at default home directory['CONTENT_SERVER_DOMAIN_NAME'], ENV['CONTENT_SERVER_FTP_LOGIN'], ENV['CONTENT_SERVER_FTP_PASSWORD']) do |ftp|
brianburridge / wordpressxml2jekyll.rb
Last active June 23, 2023 15:38 — forked from rzhw/wordpressxml2jekyll.rb
Convert Wordpress xml export to Jekyll format using Markdown
#!/usr/bin/env ruby
# Input: WordPress XML export file.
# Outputs: a series of Markdown files ready to be included in a Jekyll site,
# and comments.yml which contains all approved comments with metadata which
# can be used for a Disqus import.
# Changes from the original gist:
# 1. Handles titles containing special characters. Those have to be YAML escaped
# 2. Use the original permalinks in wordpress.