Skip to content

Imgur plugin doesn't get titles for "subreddit gallery" images #129

Description

@alanbriolat

This problem was confirmed with https://i.imgur.com/BAiuZQl.jpg. When you visit the imgur page at https://imgur.com/BAiuZQl there is a title for the image, including in the <title> tag. However, the "image" API response has "title": null. There is another API endpoint for "subreddit gallery image" that does have a title set (and which corresponds to that in the HTML response).

My best guess is that this is some kind of integration that is pulling data from reddit at some point. So far I haven't found anything in the "image" response that unambiguously suggests there might be a better response for "subreddit gallery image" (unless "section" is only used for subreddit images), but it looks like any arbitrary subreddit name can be used, so it might be worth just making the second call if the first one has no title.

"Image" API response (https://api.imgur.com/3/image/BAiuZQl):

{
    "data": {
        "id": "BAiuZQl",
        "title": null,
        "description": null,
        "datetime": 1519750814,
        "type": "image/jpeg",
        "animated": false,
        "width": 1200,
        "height": 905,
        "size": 85959,
        "views": 79858,
        "bandwidth": 6864513822,
        "vote": null,
        "favorite": false,
        "nsfw": false,
        "section": "ProgrammerHumor",
        "account_url": null,
        "account_id": null,
        "is_ad": false,
        "in_most_viral": false,
        "has_sound": false,
        "tags": [],
        "ad_type": 0,
        "ad_url": "",
        "in_gallery": false,
        "link": "https://i.imgur.com/BAiuZQl.jpg"
    },
    "success": true,
    "status": 200
}

"Subreddit gallery image" response (https://api.imgur.com/3/gallery/r/ProgrammerHumor/BAiuZQl):

{
    "data": {
        "id": "BAiuZQl",
        "title": "Don't use hacking characters",
        "description": null,
        "datetime": 1519750854,
        "type": "image/jpeg",
        "animated": false,
        "width": 1200,
        "height": 905,
        "size": 85959,
        "views": 80135,
        "bandwidth": 6888324465,
        "vote": null,
        "favorite": false,
        "nsfw": false,
        "section": "ProgrammerHumor",
        "account_url": null,
        "account_id": null,
        "is_ad": false,
        "in_most_viral": false,
        "has_sound": false,
        "tags": [],
        "ad_type": 0,
        "ad_url": "",
        "in_gallery": false,
        "link": "https://i.imgur.com/BAiuZQl.jpg",
        "comment_count": null,
        "favorite_count": null,
        "ups": null,
        "downs": null,
        "points": null,
        "score": 25565,
        "is_album": false
    },
    "success": true,
    "status": 200
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions