Git Product home page Git Product logo

ruby-twitpic's Introduction

This library is abandonded and I no longer work at Twitpic. It's probably not a good idea to use it.

Twitpic is dead. You probably, really truly, do not want to be using this. Think of it as a relic from the past. It’s kind of like you’re visiting a museum.

TwitPic API for Ruby

The TwitPic library provides full access to the TwitPic API, including photo uploads (uploadAndPost not implemented yet) and write-enabled API methods.

Dependencies

All of these are required, but are available as gems:

  • Nestful (used to be Net::HTTP, switched to Nestful to make the code cleaner and shorter)
  • ROAuth
  • JSON

Install

gem install twitpic-full

Example Usage

Check out the examples in the examples folder to find out how to use the library. The gist of it is:

require 'twitpic'

twitpic = TwitPic::Client.new

# This part is optional and only required if you are calling
# write enabled methods against the TwitPic API.
twitpic.configure do |conf|
  conf.api_key = "your API key"
  conf.consumer_key = "your consumer key"
  conf.consumer_secret = "your consumer secret"
  conf.oauth_token = "users oauth token"
  conf.oauth_secret = "users oauth secret"
end

user = twitpic.users(:show, {:username => "some_username"})
puts "User ID: #{user['id']}"
puts "Last Photo: http://twitpic.com/#{user['images'][0]['short_id']}"

media = twitpic.upload("path/to/file.jpg", "My photo caption")

Project To-Do

  • Unit testing
  • More examples perhaps?

ruby-twitpic's People

Contributors

meltingice avatar stevencorona avatar

Stargazers

Nico Bosshard avatar James Gifford avatar  avatar Lasse Bunk avatar Aleksandr Zykov avatar Dzmitry Ilyashevich avatar Simon Hürlimann avatar Ben Reubenstein avatar

Watchers

 avatar

Forkers

phlegx

ruby-twitpic's Issues

uninitialized constant PhotosController::TwitPic

Hey,
I'm trying to implement your library but I got some issues.

First I've installed necessary gems:

carlo@hd:~/public_html/hdr3dev$ gem install twitpic
Fetching: highline-1.6.5.gem (100%)
Fetching: oauth-0.4.5.gem (100%)
Fetching: rubytter-1.4.2.gem (100%)
Fetching: twitpic-0.3.1.gem (100%)
Successfully installed highline-1.6.5
Successfully installed oauth-0.4.5
Successfully installed rubytter-1.4.2
Successfully installed twitpic-0.3.1
4 gems installed

carlo@hd:~/public_html/hdr3dev$ gem install twitpic-full
Fetching: nestful-0.0.7.gem (100%)
Fetching: json-1.6.1.gem (100%)
Building native extensions.  This could take a while...
Fetching: roauth-0.0.8.gem (100%)
Fetching: twitpic-full-1.0.0.gem (100%)
Fetching: multi_json-1.0.3.gem (100%)
Successfully installed nestful-0.0.7
Successfully installed json-1.6.1
Successfully installed roauth-0.0.8
Successfully installed twitpic-full-1.0.0
Successfully installed multi_json-1.0.3
5 gems installed

I edited environment.rb as following:

config.gem 'twitpic-full', :require => 'twitpic'

Then I've edited my code as below:

class PhotosController < ApplicationController

  def posttwitpic

    @photo = Photo.find(7)

    twitpic = TwitPic::Client.new

    # This part is optional and only required if you are calling
    # write enabled methods against the TwitPic API.
    twitpic.configure do |conf|
      conf.api_key = "..."
      conf.consumer_key = "..."
      conf.consumer_secret = "..."
      conf.oauth_token = "..."
      conf.oauth_secret = "..."
    end

    media = twitpic.upload("#{@photo.cloudfront_url(:medium)}", "TwitPic test #photography")
  end

end

This is the error I got:
uninitialized constant PhotosController::TwitPic

Can you help me with this?

Version issues

Hi meltingice,

I noticed that on rubygems we have version 1.0.1 of ruby-twitpic (twitpic-full) but on github we do have version 1.0.0. Is there a reason for that? Which is the more recent gem now, the one here or the one on rubygems.

thank you
p

gem

Hello,

Please, make a gem from this library.

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.