Get photos from stream

1.5k Views Asked by At

Is there a way to get all of the photos form a given stream query? I tried the following but it returns an empty set.

SELECT pid, aid, src_big FROM photo WHERE pid IN (SELECT attachment.media.photo.pid FROM #feed)
1

There are 1 best solutions below

0
On

Its tough to tell since I can't see your '#feed' query but more than likely you are missing a stream_filter query. This would give you something like the following 3 queries. Good Luck!

Query 'key':

SELECT filter_key
  FROM stream_filter
  WHERE uid = me() AND name = 'Photos'

Query 'feed':

SELECT attachment.media.photo.pid
  FROM stream
  WHERE source_id = {id here} AND filter_key IN (SELECT filter FROM #key)

Query 'photos':

SELECT caption, src_big, modified
    FROM photo
    WHERE pid IN (SELECT pid FROM #feed)