Providing Better Meta Tags for the Rest of Us

Story 1 – Meta Tags

With messaging systems trying to satiate information-hungry users, it’s fascinating to see how standards are popping up around the decades old infrastructure of the internet. I’m talking, of course, about the meta tags and their evolution, or lack thereof. When sharing links on popular platforms, the new standard is to show a preview of the link so that users can know what they’re about to click on. Facebook introduced a new standard to help unify sites around the web and make information more easily scrape-able. Since then, there have been more standards added on to the age-old infrastructure of meta tags.

Story 2 – Serverless Architecture

A quite fascinating and paradigm-shifting technology is peeking its head on a lot of cloud platforms: serverless/Functions as a Service (FaaS). The possibilities that this technology opens up are not only quite endless, but also pretty darn cool. The premise is that one can deploy a simple function and only pay for the length of time that the function took to complete running. This is a great addition to micro-services and can instantly lower an API’s costs. Since well-designed API’s are stateless anyway, one doesn’t need a server constantly up, but only spun up as needed. It’s easy to see that FaaS can very easily turn API hosting on its head. And given my great interest in backend architecture and API design, I’ve been itching for a good excuse to play around with serverless architecture.

Story 3 – The Convergence

Meet Better Meta, the API that allows you to quickly and easily fetch any site’s meta tags in a digest-able JSON format, built on AWS’ Lambda. Better Meta is the perfect example of an API that can run simply in AWS Lambda with minimal resources and provide valuable information in a readable format for other developers to use in their applications. This allowed me to play with Lambda and get a feel for the serverless world and API’s, work with XPath (the scraping needs to be done somewhere, right?), study a bit of the history of the internet and evolution of meta tags, and of course, provide a valuable resource for fellow developers. Happy meta tagging!

Water

“Be like water making its way through cracks. Do not be assertive, but adjust to the object, and you shall find a way around or through it. If nothing within you stays rigid, outward things will disclose themselves.

Empty your mind, be formless. Shapeless, like water. If you put water into a cup, it becomes the cup. You put water into a bottle and it becomes the bottle. You put it in a teapot, it becomes the teapot. Now, water can flow or it can crash. Be water, my friend.”
― Bruce Lee

Even before I came across this fantastic Bruce Lee quote, I felt this. I called it ‘neutral’. I feel like I’m a ‘neutral’ guy. I have a very easy time adapting to situations and getting along with people. I dislike very few people. I’m usually quite content wherever I am and with whatever I’m doing. Honestly, I feel like I have it too easy sometimes.

However, nowadays, when I’m faced with a tough (and sometimes even not so tough) situation, I don’t know what to do. I’m almost /too/ neutral. If I’m always content, I don’t have a preference for some things. Water is /too/ shapeless. I want to be jelly. Easily adaptable, but still have a shape of my own when I want. Does anyone have some gelatin?

Netflix and Why Options Are Bad For You

I will make your life better by taking away your choices.

I probably sound crazy right now. Let me change your mind.

How often do you find yourself drowning in a vast, empty sea of television shows and movies without giving a single shit about which one you watch? It’s like walking down the aisle in a grocery store and searching through an endless variety of laundry detergents when all you want to do is get that damn stain out of your good shirt.

As it turns out, there’s a reason for this uncertainty you experience when browsing through too many options. It’s called the Paradox of Choice. I came across this feeling first on Netflix. I found myself never being quite satisfied with whatever I watch on the brilliant streaming service.

That’s where Netflixr comes into play. A quick bookmarklet that will give you just a few random options from the Netflix page you’re currently viewing. It’s pretty simple, but sometimes that’s the way it should be. Mindless television should be a bit more mindless.

With more options comes more responsibility.

Think of it like this: Given a thirty minute break for lunch, you have enough time to heat up a quick meal and watch something before getting back to work, with a little wiggle room to get your mac n cheese to the right temperature. The longer it takes you to decide between It’s Always Sunny in Philadelphia, the Office, or Derek, or anything else, that’s less time you get to eat and enjoy your damn television show.

Turns out, I wasn’t the only one thinking this way. Sheena Iyengar, who literally studies how people choose, has a TED talk about the very same topic. In it, Iyengar mentions that more options will sometimes make it more difficult for people to commit. She then goes on to mention a few ways to make that decision easier for the consumer. One of those ways? You guessed it. Cutting options.

I will make your life better by taking away your choices.

Who’s crazy now? 😉

As usual, to install the Netflixr bookmarklet, drag this link to your address bar. Simply click on the bookmark on any Netflix page, and viola!

Optimizing Grocery Shopping – Superbetize

You run to the grocery store. You forgot all about your hot date who’s coming over soon and expecting a lovely home-cooked meal. As you run down the aisles, picking up the ingredients you typed in on your phone, you realize you’re going to be late. Not a good first impression… The items in the list are all over the place, making you run back and forth through the grocery store aisles as if you work there. If only there was a quick and easy way to view your shopping list already categorized…

Well now there is!

I’d like you all to meet Superbetize. This site will take your list of groceries, and categorize (super-betize!) them in different sections found in most grocery stores (e.g. produce, frozen foods, household supplies, etc.). The site provides a nice mobile interface as well so you can easily use it on your phone while traversing the grocery store aisles.

I am very proud of Superbetize. Some may even say that I’m super proud of it. I believe I’ve managed to solve a problem experienced by many, but spoken about by none. I also used this project as an excuse to learn some new and interesting technologies. Those include: Bootstrap, mod_rewrite, and cron jobs.

 

I want to introduce you to a problem I had while developing this site. The ‘groceries array’ that I use to actually sort through the grocery list was manually created by yours truly. I knew there was no way I’d be able to get everything right the first time, between all the different brands, categories, and spellings of product names. I needed a way to update this groceries array regularly with items that weren’t already in the list. This is where cron jobs come in to play.

Cron jobs are scripts that run on a schedule. These are usually used for automated backups or system administration. For each script, you can simply tell it the interval to run (daily at noon, Fridays at 5pm or once a year on April 20th). I created a simple cron script to run once a week that will collect all of the ‘Uncategorized’ items (which were stored in a separate table in my database) that went through Superbetize, and email that list to me. It works beautifully.

Once a week, on Sunday nights at 1am, I get an automated email coming from my hosting provider (where the cron script is hosted), with a list of all of the uncategorized items that were sorted in the past week. I simply add those items manually to my groceries array in the proper category, and update the live grocery array! This way you know if Superbetize couldn’t get your item once, next time it’ll be in the proper place 😉

Ideas, suggestions, and criticisms are welcome! Enjoy!

 

FB Friend Selector

It doesn’t happen often, but when you’d like to invite ALL of your friends to your Facebook event, you’re left with the daunting task of having to go through and click on each person, one by one.

Well not anymore!

Using what I learned from my previous project, a simple bookmarklet will allow you toggle all of your friends with one click.

To use it:

1. Drag the following link to your bookmarks bar.

2. Go to your Facebook event page and open the ‘Invite Friends’ dialog.

3. Make sure to scroll all the way down, so it loads all of your friends.

4. Click on the link you just bookmarked.

5. Depending on how popular you are, it may take a second. Then you’re done!

As per usual, here is a link to the pure JavaScript file.

Enjoy!

FCCheck

If you’re simply looking for FCCheck, a quick and easy way to make sure lyrics are FCC clean, click here! To install this on your computer, simply drag this link to your bookmark bar. Or copy the Link Location from the link and save that as the URL for a new Bookmark item.

What?

FCCheck is a tool that will allow you to very easily view all the FCC 7 dirty words on a page. This can be especially useful for DJ’s looking to clean up some (potentially) dirty songs.

Why?

For those of you who don’t know, I am an underground hip hop DJ on WKNC. Check out my co-host (Casual-T) and me (tomeslice) on Sunday nights, midnight-1:30 am. Tune in: http://wknc.org/listen.

It didn’t take us long to find out that one of the hardest parts of being hip hop DJ’s was finding clean music. For each song we wanted to play, we had to look up the lyrics, use the Find command and search for the ‘dirty 7’, an informal list that the FCC uses to make sure radio broadcasts are age-apropriate, and then skim the page just in case we missed something. This process became long and tedious after some time, as you might imagine. So I threw my thinking cap on, and in just one afternoon was able to come up with a solution: FCCheck.

I wanted to automate the process of searching for the dirty 7 in a lyrics page. I’ve used UserScripts before, but the nature of the UserScripts wasn’t what I was looking for. I wanted a button of some sort that I could click on while I was browsing any page, and for it to count how many occurrences of each word was on the page. And just for fun, highlight each occurrence as well. I was sadly coming to the realization that I may need to turn this project into a browser add-on. This isn’t a big deal, except for that I didn’t want to have to make 4 browser add-ons for each browser. Plus, I wasn’t familiar with how to go about doing this.

And then it hit me: bookmarklets.

If you haven’t heard of bookmarklets, you’re missing out. Bookmarklets let you store a JavaScript function, as a URL, in your bookmarks. This means that you can have the power of JavaScript, on any page you’re browsing, just a click away. To see how powerful these can be, check out some of these:
Kick Ass – Turns any page into an interactive, Asteroids-like game
Mark Up – Let’s you draw and write notes on any page you’d like, and then share it with the Mark Up Community
Urban Dictionary Lookup – Looks up the selected term on the page on Urban Dictionary
Wikipedia Lookup – Looks up the selected term on the page on Wikipedia

A bookmarklet was so perfect for this project, I don’t know how I didn’t realize it earlier. A few hours later, FCCheck was born. Try it, click on it! (To install FCCheck, drag the previous link to your bookmarks bar. You’re done!)

How?

The first thing I did was made sure the bookmarklet pointed to my servers to fetch the script. This has a few advantages. If I ever want to update the script, make it more efficient, or add some features, it will automatically show up for everyone who’s using the same bookmark! Plus, I can easily track and see how many people use the script. However, hosting the script on my server means that it can’t be edited by the user. And for that purpose, as well as if you’d just like to check out my code, here is a link straight to the JavaScript so you can do with it what you please!

Next, I needed a good way to count occurrences of words on the page, and then highlight them. As of now, RegEx is used to count the occurrences, and a third-party script searches through the page’s source and highlights each word on the page. Then an alert is shown displaying the number of occurrences of each word in the dirty 7 array, and a total at the bottom.

While I can say with great certainty that it should work correctly most of the time, please make sure you look over FCCheck’s results. I do not want to be held liable in case of any mishaps. Also, keep in mind that FCCheck will scan the WHOLE PAGE when looking for cuss words. On lyric sites where people post comments at the bottom, or if there are links to other songs at the sidebars, FCCheck will tally up those words as well. In other words, please use caution while using this bookmarklet and remember that it is not a one-all solution.

Thoughts? Improvements? Efficiency boosts?