30

I am searching for a specific image posted on one of my questions or answers about 2-3 years ago. I have asked many questions and also answered on stackoverflow.com.

I don't remember in which question I posted that image. I have tried to search it in many ways by filtering questions in many different ways, but I was unable to find that image. So, I want all the images that I posted on Stack Overflow at anytime.

Is it possible to get them all or have I to look for each question and answer?

2 Answers 2

45

This SEDE query gives you links to all your posts with images in it and produces html markup to quickly show all those images in an html page, or in this case, simply in this answer:

select '<hr><a href="https://stackoverflow.com/q/' 
     + cast(id as nvarchar)  
     + '"><' 
     + value 
     + '</a>' as url
from
(
select id , value
from posts
cross apply string_split(body,'<') spl
where owneruserid = ##userid?2284240##
and body like '%<img %>%'
and value like 'img %'
) as data

The images are linked so you can click on them and that will bring you to the correct post.

The query uses the same technique as Aurora0001 to find posts with any image but then I cross join with a table created by the string_split function. That splits on the character < to find a possible start of an html tag. By only including values that start with img we have a high chance to find markup for images. This makes that we can handle more then one image in a post's body.

I've only included a top 5 here, just to show how it would work in an html page, the markup looks like this:

<hr><a href="https://stackoverflow.com/q/16388080"><img src="https://i.stack.imgur.com/c49Fs.jpg" alt="enter image description here"></a>          
<hr><a href="https://stackoverflow.com/q/16388080"><img src="https://i.stack.imgur.com/FroRO.jpg" alt="enter image description here"> </a>         
<hr><a href="https://stackoverflow.com/q/16405837"><img src="https://i.stack.imgur.com/AfW4g.jpg" alt="enter image description here"></a>          
<hr><a href="https://stackoverflow.com/q/17007222"><img src="https://i.stack.imgur.com/uN1TW.jpg" alt="enter image description here"></a>          
<hr><a href="https://stackoverflow.com/q/17007222"><img src="https://i.stack.imgur.com/VkZPI.jpg" alt="enter image description here"></a>          

resulting in this rendered output. You can now quickly look at all pictures without having to navigate to each post.


enter image description here
enter image description here
enter image description here
enter image description here
enter image description here
10
  • Thanks for the effort. Your answer looks more relevent than other answer. Can you please, tell me how can I find images for the posts that are deleted by me
    – Vishal
    Jan 20, 2018 at 12:21
  • 2
    @Vishal you can't now, you'll need 10K to be able to use deleted:1 in the site search bar. SEDE doesn't have the content of deleted posts (only some meta data). The next best thing would be using the Stack Exchange Datadumps but you'll have to download, import and search that by yourself loading all posts.xml from the beginning of time till now.
    – rene
    Jan 20, 2018 at 12:27
  • You have more than 10k reputation. Can you please try to find an image of menu in dark-gray background?
    – Vishal
    Jan 20, 2018 at 12:34
  • 4
    I can't search deleted posts that are not my own.
    – rene
    Jan 20, 2018 at 12:35
  • @Vishal do you have a vague recollection of what it looks like? Would it be an image on a phone screen for example? (something like: i.stack.imgur.com/m7jEp.png) ? Jan 20, 2018 at 13:57
  • @JonClements Yes, I can remember the image. It's not a phone screen. It's a desktop application menu. It's background is nearly black and it has a glossy style for selected menu item. The menuitems are Masters, Transactions, Reports, etc...
    – Vishal
    Jan 20, 2018 at 14:57
  • @Vishal nope - can't help you there... I've had a quick look at any deleted posts by you with images that used the SO imgur service and there's nothing like that. Jan 20, 2018 at 15:03
  • @JonClements Thanks for trying to help me.
    – Vishal
    Jan 20, 2018 at 15:56
  • 8
    This answer is okay, but it doesn't make my coffee for me in the morning or do my laundry. Jan 22, 2018 at 15:50
  • 4
    @Jean-FrançoisCorbett you need to include jQuery, then it works fine.
    – Braiam
    Jan 22, 2018 at 20:27
11

This Stack Exchange Data Explorer query will find all posts where you included a link or image on the i.stack.imgur.com domain (which, if you used the official image uploader, is the domain your images are stored on):

DECLARE @UserId int = ##UserId##;

SELECT Id AS [Post Link], * FROM Posts where OwnerUserId=2284240 and Body LIKE '%i.stack.imgur.com%';

I found 56 posts that match the search, which you can look through, or filter further if you have any other criteria you remember.

3
  • 7
    Or just use the SO search: user:2284240 url:i.stack.imgur.com... Jan 20, 2018 at 11:39
  • 4
    And then, since you've got a rough timeline, use user:2284240 url:i.stack.imgur.com created:3y..20m - that results in 4 posts... Jan 20, 2018 at 11:48
  • 1
    Thanks man! I took a look to all the 56 images but still I was not able to find the image. I think I might have deleted that question in past.
    – Vishal
    Jan 20, 2018 at 11:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .