In this post, I illustrate all the Substack embeds and declare that I'm a Swiftie.1
Sadly, this post is too long for email. You might need to view it on the web. 😱
Are you ready for it?
Video
Giphy animations
Youtube
Vimeo
Audio
Spotify
Apple Podcasts
SoundCloud
Bandcamp
Files
PDFs
Excel spreadsheets (XLSX)2
Comics files (CBZ, CBR)3
Social networks
Substack newsletters
Post
Publication
Other
Github Gists4
require 'nokogiri' | |
require 'classifier' | |
require 'open-uri' | |
@skynet = Classifier::Bayes.new 'lady_gaga', 'taylor_swift' | |
def train_skynet(url, trainer) | |
# Grab the HTML from the url | |
html = open(url) | |
# Extract the lyrics from the #lyrics-body-text div | |
lyrics = Nokogiri::HTML(html).css("#lyrics-body-text").text | |
# Filter text to ensure only alphanumeric characters and | |
# appropriate punctuation are used | |
lyrics.gsub!(/[^A-Za-z0-9,.'\s]/, ' ') | |
# Feed each line to skynet | |
@skynet.send(trainer, lyrics) | |
end | |
# From http://www.metrolyrics.com/taylor-swift-lyrics.html | |
taylor_swift_urls = [ | |
"http://www.metrolyrics.com/i-knew-you-were-trouble-lyrics-taylor-swift.html", | |
"http://www.metrolyrics.com/teardrops-on-my-guitar-lyrics-taylor-swift.html", | |
"http://www.metrolyrics.com/we-are-never-ever-getting-back-together-lyrics-taylor-swift.html" | |
] | |
taylor_swift_urls.each do |url| | |
train_skynet(url, :train_taylor_swift) | |
end | |
# From http://www.metrolyrics.com/lady-gaga-lyrics.html | |
lady_gaga_urls = [ | |
"http://www.metrolyrics.com/bad-romance-lyrics-lady-gaga.html", | |
"http://www.metrolyrics.com/telephone-lyrics-lady-gaga.html", | |
"http://www.metrolyrics.com/pokerface-lyrics-lady-gaga.html" | |
] | |
lady_gaga_urls.each do |url| | |
train_skynet(url, :train_lady_gaga) | |
end | |
puts @skynet.classify "Shake it off, shake it off!" | |
puts @skynet.classify "At least that's what people say mmm, that's what people say mmm" | |
puts @skynet.classify "But I won't stop until that boy is mine" | |
puts @skynet.classify "Papa-paparazzi" | |
puts @skynet.classify "I'll follow you until you love me" |
OpenSea
Kindle
?5
Re the title and subtitle of this post: It’s remarkably difficult to think of puns related to both Taylor Swift and embeds. But I found a way. I’m not saying they’re great puns…
If you need assistance with embeds, one service I provide with paid subscription is unofficial-yet-useful Substack technical support.
But here’s my free advice. If a link you paste in or file you drag to the desktop Substack editor doesn’t turn into an embed, try again. If it still doesn’t work, check if there’s a problem with the link or file. (If the editor doesn’t support a type of link. try a different one if possible.) On mobile, getting links to become embeds is trial-and-error for me.
I didn’t find a good public domain spreadsheet about Taylor Swift. So I went with a spreadsheet with “13” in the title. #taylorswift13
If you consider images to be another type of embed, here’s one of the images contained in the CBZ file:
Don’t click “Show hidden characters” in the gist. That will result in an error page. Instead, if you want to see the original text, click on one of the links at the bottom of the gist.
I couldn’t figure out how to embed a Kindle file or Kindle URL. Perhaps the Kindle embed is like the Karma album – it will be available someday, maybe soon...
Very helpful to see these examples. Thank you!
Nice work putting this together, Scott!