Wednesday, October 29, 2014

MakerSquare Day 45: Final project #2 -- but really home sick (10/2)

I went home early on Tuesday, since I've caught that cold that's going around. (Or at least, that my housemate has.) So this'll be a short post, with the sound of me sniffling and coughing in the background.

Luckily, Tuesday was the first day of our second final project, and I've chosen a manageable project right now / for once: a Chrome extension that will block spoilers on Twitter.

So I didn't get that much done on Tuesday since my primary goal for the day was to always have a hot tea with me at all times. But right now, here's the minimum viable product plan, some notes on my progress, and some current pain points, along with some extension ideas.

Minimum viable product:

  • The user can engage the extension and type in a word or phrase that'll trigger the blocker, e.g., "Game of Thrones."
  • All tweets with that word / phrase will be hidden (both words and pictures).
  • The user will be able to show any hidden tweet if they choose to by clicking on the hidden tweet.

Some notes:

  • At first I looked into grabbing all the children of the container object in the tweet stream:
    • $('ol.stream-items').children()
  • ... but then I realized I could just grab the individual tweets directly (and put them into a variable, which I then iterate over):
    • var tweets = $('li.js-stream-item')
    • for (tweet in tweets)
  • It's not terribly hard to hide the tweets and pictures (though I also thought about other ideas, including detaching the material with .detach() ):
    • $(tweet).find($('.tweet-text')).hide()
    • $(tweet).find($('.js-media-container')).hide()

Some pain points:

  • Right now, I'm having some trouble putting in a button that'll respond to a user's click to show the hidden tweet. When I put something in the tweet space, it acts like a normal tweet acts when clicked, i.e., it expands.
Some extension ideas:

  • It would be super-neat for this extension to block tweets that had the trigger words, but also to find some related tweets to block. So, e.g., if you put in "Game of Thrones," the extension might also block out certain related words like "Red Wedding."
  • It would be (slightly less super) neat for this extension to be platform agnostic, so you could block spoilers in, say, Facebook or elsewhere.

No comments:

Post a Comment