Group filter on subtype

Just like the latest discussion filter in groups (

I need someting that can also filter the subtypes of the object too..

1. Photos (Tidypics Photo Gallery)
2. Videos (Videos 1.4)
3. Blog (Blog 1.8)
4. Files (File 1.8.1)

So that when i go for "groups/all?filter=photos" then i will be able to see all the photos of every group
similarly for "filter=videos" will show all the group videos, "filter=blogs" will show all the group blogs and finally "filter=files" will show all the group files.

How can this be implemented?

I am still a noob so it would be great if i get the source code. That will help me a lot.