Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lrd_twimage

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lrd_twimage

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Twimage

This is LRD's fork of twimage by Rob Cameron. Our fork adds support for lockerz.com image service, and fixes a problem we ran into on some twitpic images.

Twimage provides an easy way to pull raw images from the various Twitter photo image services (twitpic, yfrog, etc.)

Usage

Add twimage to your Gemfile:

gem 'lrd_twimage'

Of without bundler:

gem install lrd_twimage

Now simply take the standard URL that is posted to Twitter and tell Twimage to go get it:

result = Twimage.get('http://instagr.am/p/EHqLG/')

Twimage will create a Ruby tempfile with the image. To get the tempfile:

result.tempfile

Save the image to your local system, upload to S3, etc. As soon as there are no more references to the tempfile in your code it will be unlinked (deleted). There are a couple additional instance variables you have access to...try result.inspect to take a look.

Twimage will follow any redirects that eventually get you to any of the included services. So, if you have a Instagram image behind a Bitly shortened URL, just give the Bitly link to Twimage and he'll (she'll?) take care of the rest.

Enjoy!

Support

LRDTwimage currently supports the following services:

  • twitpic - http://twitpic.com
  • yfrog - http://yfrog.com
  • instagram - http://instagr.am
  • lockerz - http://lockerz.com

Contributing

To add a parser, fork this repo and then send me a pull request. You should attempt to get the highest resolution version of the image possible, which isn't always available at the link posted to Twitter. Check out the SERVICES constant in twimage.rb for examples of lambdas used to modify the original service_url to get to the full res version's URL.

FAQs

Package last updated on 20 Oct 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc