Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7170863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:17:49+00:00 2026-05-28T15:17:49+00:00

I’m trying to list the albums from a single user in imgur . As

  • 0

I’m trying to list the albums from a single user in imgur. As far as I’ve read in the API, information about albums can only be fetched using the authenticated API, which is quite a curious decision, because you can upload images and messages with the anonymous API but can’t get public information like lists of albums.

Anyways, looks like the auth API uses OAuth. I’ve been trying to find a way of making it work, with no luck. On of the reasons is that my hosting does not offer the official PHP’s oauth extension, so I need an external library.

Do you have any example of working with imgur and oauth?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:17:50+00:00Added an answer on May 28, 2026 at 3:17 pm

    There are a few good pure-PHP OAuth options for you that are worth mentioning. In order to understand their good parts and bad parts, it’ll be nesecary to understand how OAuth works. Let’s review.

    In this example, the Provider is Imgur, the Consumer is your code, and the User is the user.

    1. The Provider issues a Consumer Key and a Consumer Secret to the Consumer.
    2. A User makes a request to the Consumer.
    3. The Consumer asks the Provider for a Request Token and Request Secret. These are usually stored in the User’s session.
    4. The Consumer redirects the User to the Provider with the Request Token. Most examples on the net now set the user’s session state to “1”.
    5. The User authorizes the Consumer’s access with the Provider.
    6. The Provider sends the User back to the Consumer with (another?) Request Token.
    7. The Consumer sends the returned Request Token and the previously sent Request Secret to the Provider.
    8. The Provider returns an Access Token and Access Secret. These are usually stored in the user’s session, but they can be long-lasting and might deserve a better long-term storage location.
    9. Further requests from Consumer to Provider require the Consumer Key, the Consumer Secret, the Access Token and the Access Secret.

    When we hit step 9, the OAuth object in your code has all it needs to perform requests. The key, critical part is that the OAuth object must handle API requests itself so that it can properly sign the data being sent over the wire.

    There are two good options for you to pick from, and some not-so-good. Let’s review the good ones:

    First is PEAR’s HTTP_OAuth, which uses HTTP_Request2 as the underlying HTTP library. While it works fine, HTTP_OAuth_Consumer_Request acts as a gateway to the request object, but doesn’t inherit from it. This means that you can’t do everything to it that you can do to an HTTP_Request2. This can be annoying.

    Second, there’s Zend Framework’s Zend_Oauth, which uses Zend_Http_Client as the underlying HTTP library. While it’s part of the larger Zend Framework, the two components are largely independent and work well with other frameworks… or no framework. Unlike the PEAR library, Zend_Oauth_Consumer actually returns a class that derives from Zend_Http_Client. That’s not to say it doesn’t do it’s own weird thing. Instead of asking you to stash away the token and secret in the session, it wants you to serialize a status token object instead, which contains the token and secret. It gets the job done, but it’s just weird.

    Ignoring the warts, both are fine options for you. They’re both released under liberal open source licenses, so you won’t have a problem bundling them with your code. *

    In the not-so-good category, there’s oauth-php. I didn’t care working with the library, too many distractions and little things that irritated me about it. There’s also PECL’s oauth extension. While it uses CURL, it’s impossible to get the CURL handle out of it to make your own sane requests. You’ve also mentioned that you don’t have it installed, which is why it’s in the not-so-good category.

    As for interfacing with Imgur… it’s just plain vanilla JSON. Throw around PHP’s native json_encode and json_decode and you won’t have a problem at all. The API documentation is pretty darned good.

    * I am not a lawyer, you might want to consult one.
    (Parts of this answer are copied verbatim from, as it happens, an incomplete Imgur API library I started writing. Unfortunately I did not implement anything about albums, otherwise I’d just link it. Once it did what I needed it to do, I stopped. Sorry.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I have a view passing on information from a database: def serve_article(request, id): served_article
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.