Code Monkey home page Code Monkey logo

blackbirdpy's Introduction

Blackbirdpy is a set of scripts and styles for quickly embedding "live" tweets in blog posts or other web articles. All links within the tweet, including URLS, screen names, and hashtags are fully clickable. It accesses the Twitter API, but does no user tracking, cookie planting, or other sketchy business.

There are three parts to blackbirdpy:

  1. A Python script that takes a tweet's URL as its command-line argument and returns a chunk of HTML for embedding. The HTML puts the tweet in a <blockquote> structure and is intended to look decent in an RSS reader.
  2. A CSS file that styles the elements of the embedded tweet.
  3. An AppleScript that gets the URL of the frontmost Safari window and passes it to the Python script, returning the HTML chunk. I use this in a TextExpander snippet, so I can simply type ;tweet in my text editor and insert the HTML chunk into the article I'm writing.

The idea is to provide an embedded tweet that looks like a tweet (without the follow, favorite, retweet, etc. buttons) and which degrades to a simple quotation when viewed in RSS.

This copy was forked from DrDrang’s project in order to add new functionality:

  • If the tweet contains a retweet, that retweeted tweet is fetched and embedded along with the main tweet.
  • If there is a photo in the tweet, the script downloads a local copy of that, too.
  • Spits out Pollen markup instead of HTML (but I’ve left most of the original code for HTML code intact in case you want to use it.)

Here's an example, which sort of matches what you'd see in an RSS reader:

Embedded tweets don’t have to be fragile or track cookies: leancrew.com/all-this/2012/…
  — Dr. Drang (@drdrang) Thu Jul 12 2012 11:34 PM CDT

If you follow the link in the tweet, you'll see several tweets.

Blackbirdpy was forked from Dr Drang’s project, which was forked from Jeff Miller's project, , which was, in turn, inspired by Robin Sloan's Blackbird Pie, a JavaScript tool for embedding tweets that Twitter seems to have removed in favor of a more complicated embedding code that I don't like the look of.

blackbirdpy's People

Contributors

drdrang avatar jeffmiller avatar otherjoel avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.