.CK 10:13am, 27 June 2006

This is an extended work of this script.

A Virtual Set is not a real photoset in Flickr. It's a set of photos sharing common properties or "things", say, your favorites, same tags, or same privacy settings. This script builds a navigating photostream box for each pre-defined virtual set. When you surfing photo pages, if a photo is in any of the virtual sets, the photostream box(es) will be opened automatically.

In the "You" menu, this script will insert a link - "Your Virtual Sets" to let you choose which virtual sets you want to enable. The preference is stored in your Firefox. Now we have 6 pre-defined virtual sets:

1. My Favorites - a collection of favorite photos
2. Recent Photos of Contacts - recent uploaded photos of your contacts, one photo per user
3. My Private Photos - all my private photos (not for friends and family)
4. Interesting Photos - 500 photos from Interestness API
5. Geotagged Photos - photos with "tag: geotagged" of the current user
6. Friends Only - photos only visible to friends of current user

Download: webdev.yuan.cc/greasemonkey/flickr.virtualsets.user.js

See all screenshots here.
Note: If you've installed "Flickr Favorites Virtual Set" before, you need to un-install it.
steeev Posted 12 years ago. Edited by steeev (admin) 12 years ago
this is really ingenious + extremely cool .CK! :D
i had an idea, how about letting the user create their own virtual sets as well? you could maybe get the superbatch script to work in conjunction with this one to allow you to choose the images you want to add to your own virtual sets.
.CK 12 years ago
Thanks steeev.

I've thought about letting users create their own virual sets. That's the way to explore more personal interested photos.
zachstern PRO 12 years ago
How about these additional virtual sets:
7) Photos of yours that have been favorited by the current user
8) Photos of yours that have been commented upon by the current user
And, I don't know if you can find this one out historically, but possibly can do it going forward:
9) Photos of yours that have been viewed by the current user
.CK 12 years ago

Sorry I don't understand the virtual sets you proposed. Who is the current user? I guess she/he is the owner of current photo.

A virtual set consists of a list of photos, and you are watching one of them. Take (7) as an example, if the photo is owned by the current user, it can't be one of your favorited photos.

How about - photos of yours that have been favorited by others ? commented by others?
striatic PRO 12 years ago
this is really, really, really, really, really handy!

the load time on 'my favorites' is a little long though, each time i hit a new photos {because i have a lot of favorites?}

is there any way to cache this information so it can be retrieved more quickly on each page load?
.CK 12 years ago

Yes, you have so many favorites - 3415! :)

The way to construct a long list of photos is time/resource consuming. I've thought about using cache, but not put into practice yet. This is a complicated problem. I'll see how to improve the performance.
jacqueline-w PRO Posted 12 years ago. Edited by jacqueline-w (member) 12 years ago
I love the idea of this... but it's not doing anything for me :(

It said it installed fine, and.... nothing. No new option in my drop-down menu (as shown in the screen shot), nada.

I'm using Firefox and Greasemonkey....um.... actually I can't find anything that says what version of Greasemonkey I've got, but my other flickr scripts are working fine.

[edit: Greasemonkey 0.6.4]
.CK 12 years ago

Does the item "Your Virtual Sets" appear in the drop-down menu, below the "Your Sets" item ? Did you see any errors in Javascript console?
abhic 12 years ago

This is amazing! thanks.
zachstern PRO Posted 12 years ago. Edited by zachstern (member) 12 years ago
@.CK - sorry, let me try again...
Right now, virtual sets seem only to work on individual photo pages. However, what if virtual sets also appeared when "I" (i.e., zachstern) visit "your" (i.e., .CK's) photostream page. There, I would like to see these additional virtual sets:
7) Photos of mine that you have favorited
8) Photos of mine that you have commented upon
And, I don't know if you can find this one out historically, but possibly can do it going forward:
9) Photos of mine that you have viewed

In other words, while browsing your pictures on your photostream, I'd also like to see which of my pictures you have interacted with, if any.
jacqueline-w PRO 12 years ago
"Does the item "Your Virtual Sets" appear in the drop-down menu, below the "Your Sets" item ?"

Nope, like I said, nothing changes for me at all.

"Did you see any errors in Javascript console?"

Um, I'm not entirely sure what that means, I haven't seen any errors at all, but I wouldn't know where to go looking for them either.

(also, I have restarted my browser and emptied caches and all that good stuff)
mortimer? 12 years ago
go in tools/Javascript console, clear the console (click on the bin) and reload your page. The interesting errors would be all the one that do not finish by "Declaration Dropped".
jacqueline-w PRO 12 years ago
Ok, I disabled all of the other scripts I usually have on, cleared the Javascript console thing, and reloaded. Still no new option under "You".

Two messages which DO end in "Declaration Dropped" and then these:

Error: XML tag name mismatch
Source File:
Line: 55
Source Code:

Error: XML tag name mismatch
Source File:
Line: 55
Source Code:
premasagar 12 years ago
This sounds great...
But I seem to be missing something... I install it fine and I have all the options to choose from in 'You' -> 'Your Virtual Sets', but where do I actually view the sets?
.CK Posted 12 years ago. Edited by .CK (member) 12 years ago

Virtual set is a navigating photostream box and only shown in individual photo page. Check any of your favorite or last 7 days interesting photo page, you should see it starts loading the context when the page is loaded.
.CK 12 years ago
@abhic, this is your idea. Your request inspired me. :)

zachstern wrote:
In other words, while browsing your pictures on your photostream, I'd also like to see which of my pictures you have interacted with, if any.
@zachstern, I am not sure whether I can dig that many relationships between a user and the photo watcher. It's a social network thing. The cost to gather such data seems too high. Maybe it should be part of flickr official "Explore" project.

@all, some minor bugs have been fixed. Please update.
premasagar 12 years ago
Got it...
Thanks, CK.
dazzling ray [deleted] 12 years ago
How about a virtual set based around a user identified tag?
.CK 12 years ago

Two more virtual sets are available now.

7) My Favorites owned by xxx - my favorites owned by current user
8) My Favorited Photos - my photos favorited by others

Update the script here.
.CK Posted 12 years ago. Edited by .CK (member) 12 years ago

mortimer? contributed a piece of codes to create the following two virtual sets. Thanks to him.

9) Your most interesting
10) This user most interesting

Bonus: add a "Your Popular" link to "You" drop-down menu.

Update the script here.
mortimer? Posted 12 years ago. Edited by mortimer? (member) 12 years ago
it looks like with the new version, the virtual sets show even when they are not activated: I have not checked the "Geotagged" set, but I can still see it.

And there is also a problem with the left "more" button. When you click on it, it only replaces the right side photo with the current one, instead of sliding.
.CK Posted 12 years ago. Edited by .CK (member) 12 years ago

Yes, I also noticed those bugs. I just fixed the 'geotagged' vset bug, but still working on the 'more' bug.


Two more virtual sets are contributed by mortimer.

11) Your photos in that pool
12) This user's photos in that pool
mortimer? 12 years ago
there is a bug so the vset 11 and 12 are not working: line 310,311, you inverted, in the enabled function, the vset11 and vset12.
.CK 12 years ago
@mortimer, It's fixed. Thanks.
mortimer? 12 years ago
When there is only 1 photo in the results (this happens in particular for the sets 11 and 12, as some group have this type of rules), then we see the virtual set on the right, but it's "empty" showing "this is the first photo-this is the last photo".

I don't know if this should be the behaviour (it's quite ugly like that) or if there should be nothing, or a better display just to say: only one photo.
.CK 12 years ago

You can see how flickr deals with it when only one photo in a set.
mortimer? 12 years ago
ok, so that's like you do it... fine then ;)
.CK 12 years ago

Here comes more features. In the "Photo Sets" page, either yours or others, the virtual sets will be inserted. Click any of the virtual sets, a floating div element will pop up to show photo thumbs in that set. If the virtual set belongs to you, you can add them to a real set, either a new created one or an existing one.

This might be useful. If you want to create a set to collect your favorited or most interesting photos, this script can make it very easy.

Download: webdev.yuan.cc/greasemonkey/flickr.virtualsets.user.js
mortimer? 12 years ago
Since I installed FF 2b1, this was not working. I had to change line 110 to:
if(i.className == 'Widget') {
widget = i;

(with the break)

otherwise I always received a "Illegal Value" (?) error.
.CK 12 years ago

Thanks for fixing it. It looks strange how the error happened. I havn't installed FF 2 yet, I'll watch this bug when I upgrade.
clickykbd PRO 12 years ago
Having some trouble getting all the requested sets to show up in the places they are supposed to. I disabled my GM scripts that add dynamic content in right hand column and that didn't fix it. Does this use the API?
clickykbd PRO 12 years ago
Speed request. Like the old "this user's photo in x group" script... could this perhaps only display a collapsed version of requested virtual-sets, until expanded (and then do the work?).

Speaking mostly for a photo page.
mortimer? Posted 12 years ago. Edited by mortimer? (member) 12 years ago
The fixe I gave earlier is not working on all pages. On the sets page, I still get an "Illegal Value" error, no idea what it means. replacing the for each with a normal iterative for loop fixes it.

would be nice to find what the problem is really.
.CK 12 years ago

I didn't see that error in my browser. Could you show me the complete "Illegal value" error in the console? Such as line number, or any other errors except this. Try to set DEBUG=true at the first line to see the debug info in console.


In which page did you have trouble to show the virtual sets?
The idea of collapsed version of requested virtual-sets is great. I'll try to implement it in the next release.
mortimer? 12 years ago
@.CK, as before, this is only relevant to Firefox 2b1, I didn't have this error with the previous version of Firefox.

The error is very elusive:
Error: Illegal value
Source File:
Line: 110
Source Code:

There are no previous errors from that script and the DEBUG=true only displays a line with the name of the script.

Replacing the for line 110 with this code:
for(var i=0;i<d.length;i++) {
if(d[i].className == 'Widget') {
widget = d[i];

seems to fix the problem for now. But I just don't know why it makes a difference.
.CK 12 years ago

Thanks. I've corrected line 110 to make the script compatible with Firefox 2b1.
NheavenF 12 years ago
Hello, I couldn't install the Virtualsets,
here appears error when I try to install

linie : 59
Char: 1
Error: 'unsafeWindow' is undefined
Code: 800a1391
Source: Microsoft JScript runtime error
mortimer? 12 years ago
Hum, this is a script for greasemonkey.mozdev.org, so you can only install it on Firefox.
.CK 12 years ago
mortimer? contributed an idea to search for relevant photos of the current photo. It is to search API of current photo by given its tags and sorted by relevance. It is fun and can explore more photos you are interested in. Thanks to mortimer?.

Download v2.1: webdev.yuan.cc/greasemonkey/flickr.virtualsets.user.js
NheavenF 12 years ago
Thank you all. I have downloaded. but nothing is changed in You option
I have cleared Javascript Console also. but same Option
यश 12 years ago
The "your favourited photos option doesnt work with me" it just keeps on saying loading your favourited photos but never gets to displaying them...
GuySwarbrick PRO 12 years ago
Having a few problems with this but the most 'interesting' one is trying to figure out the 'most relevant' set.

How is this


relevant to this

mortimer? 12 years ago
The "most relevant" shows the results for a tag search on flickr with all the tags attached to the photo you are seeing.

So your shot has 3 tags: June, 2005, Dinon Pastures
which are quite "broad" and therefore return as what appears as "irrelevant" results.
But, the mountain photo has a bit more tags, in which you see June and 2005.
So relativelly to the tags, it's really relevant ;)

It's no magic, the script does not interpret the photo but only the data attached to it, so perhaps, if you add tags like "flower", "macro", "petals", "pink", then what is in the shot will be more precise for the script and it will certainly return more relevant results.

I also found that some people add 100s of tags to their shot, which have nothing to do with what's in the photo (tag spam), so you'll sometime get a irrelevant photo because of these spammers :)

Anyway, I love that script, I never use Flickr's provided set and groups anymore and only navigate through the photos with the virtual sets (and the compass).
Flickr should really think about adding these features in house :D
यश 12 years ago
isnt there anything u can do about tag spamming?
Andreas Helke Posted 11 years ago. Edited by Andreas Helke (member) 11 years ago
The old version that I was using was working for me. The new one starts but dissapears from my photo pages after a few seconds. I wonder if there is a conflict with one of the other greasemonkey scripts that I am using. I tried uninstalling and reinstalling the script. But that did not change anything.
Lemon2 11 years ago
*buys you a virtual beer*

...thank you, this is a .CKing handy script :o)
hlkljgk PRO 10 years ago
ck thanks for this great script
since the new greasemonkey update it has stopped working
more here: www.flickr.com/groups/flickrhacks/discuss/72157603771669807/
Pink dream ☺ 10 years ago
any new version of this nice script which does not work now with firefox 3 ???
dodob19 10 years ago

Four small changes are needed to make this script work with Firefox 3's tighter security rules. You can probably edit them in yourself before .CK updates the scripts officially. The changes are:

- (line 489) var parser = new DOMParser();
- (line 890) var parser = new DOMParser();
- (line 921) var parser = new DOMParser();
- (line 949) var parser = new DOMParser();

In short, remove the w. from those four lines. That should do it.

For detailed instructions on how to edit the script, see steps 1, 2, and 5 here.
Pink dream ☺ 10 years ago
thanks a lot! now it works fine !
Keith_Beecham PRO 10 years ago
Suggestion, for when you look at a user who has you marked as F/F, perhaps a virtual set to see just that user's F/F pictures?
~shrewd~ PRO Posted 9 years ago. Edited by ~shrewd~ (member) 9 years ago
looks like this is true for me too. unfortunately it is constantly showing "Loading" .

see here.

any ideas?

rgds s
Switched2 kiezkicker.ipernity.com Posted 9 years ago. Edited by Switched2 kiezkicker.ipernity.com (member) 9 years ago
Is it possible to arrange it that the script shows photos from your contacts which are set to FF so you haven't take a look to their whole pages to see FF-photos after they marked you as Friend?
There are many flickrans who makes me FF recently which was nice but instead browsing throw their whole photos again I would like to view just the ones I haven't allready browsed in the past.

Oh, sorry. It's the same Keith Beecham suggested a few posts before. Next time I read the _whole_ discussion before commenting. ;)
hibijibis 9 years ago
hi there. i have installed this virtual set. thank you. there is a drop down menu, but when i click on one of my favorite photos (belongs to someone else) there is no virtual photo set option. I am using firefox 3.5. and just recently downloaded grease monkey. I tried to edit like a poster above removing the w. but didnt work either. can you help me ck?

steambadger 9 years ago
Has anybody figured out what the problem is with the "Your Favorited Photos" virtual set? It does the same thing to me.

Great script, by the way.
decembre Posted 8 years ago. Edited by decembre (member) 8 years ago
An update ?
I want to have the virtual set on the photo page , it's possible ?
For information, i try to maintain a BIG list of script which can be compatible with this New Change, here :
Scripts List Compatible With The New Photo Page in Flickr Hack
( Reedited when something change...)
B&G_Cpl 5 years ago
Not compatible with the new flickr!
Groups Beta