Search/browse programs.
URL
http://api.spokenword.org/programs[.format]?quesrystring
HTTP Method(s)
GET
You may specify zero or one of the following querystring options. You may not combine them (ie, use more than one).
Usage Examples
http://api.spokenword.org/programs?cat=G015
http://api.spokenword.org/programs?tag=publicRadio&count=25&page=3
http://api.spokenword.org/programs?tag=+publicRadio+kqed-news
http://api.spokenword.org/programs?order=submissionDate&m=a&lang=en&noexp=1
http://api.spokenword.org/programs?order=playCount&media=v&count=50&page=0
Response
Returns a searchResult object followed by an array of the specified objects: program, feed or collection.
> The plan is to replace /search with object-specific methods: /programs,
> /feeds, /collections and /members.
That makes sense.
Most people want to search that way anyway, I believe.
And we can combine the results client-side if we feel like it.
> OTOH, I can guarantee that
> everything that's allowed will be reasonably efficient.
That's a bold statement ;-)
> I've also spec'd
> requests that return almost every possible field in the database -- probably
> many more than you'll ever want.
If this becomes a problem, we could have a "returnFields" parameter.
"all": would be every field
"id": would be only the program id
"short": something in between
> *Search/Order Options*
> - *Highest-Rated*
> - ?order=ratingAverage
> - ?order=ratingAged
> - ?order=recentlyCollected
> - ?order=recentlyRated
> - ?order=mostCollected
> - ?order=playCount
> - ?order=pageviews
> - ?order=ratingCount
> - ?order=pubDate
> - ?order=recordingDate
> - ?order=submissionDate
>
I'd like to be able to use all these order options
also as filter options.
minPlayCount=4
maxPlayCount=10
minPubDate=20091010
And then, maybe playCount, rating, collected could be for a given user only:
user_maxCollectedCount=0
user_minCollectedCount=1
would return only stuff that I have not already collected,
or only stuff that I have collected, which could be very useful.
Cheers,
Thilo
> everything that's allowed will be reasonably efficient.> OTOH, I can guarantee that
That's a bold statement ;-)
> I've also spec'dIf this becomes a problem, we could have a "returnFields" parameter.
> requests that return almost every possible field in the database -- probably
> many more than you'll ever want.
"all": would be every field
"id": would be only the program id
"short": something in between
> *Search/Order Options*
> - *Highest-Rated*
> - ?order=ratingAverage
> - ?order=ratingAged
> - ?order=recentlyCollected
> - ?order=recentlyRated
> - ?order=mostCollected
> - ?order=playCount
> - ?order=pageviews
> - ?order=ratingCount
> - ?order=pubDate
> - ?order=recordingDate
> - ?order=submissionDate
>
I'd like to be able to use all these order options
also as filter options.
minPlayCount=4
maxPlayCount=10
minPubDate=20091010
And then, maybe playCount, rating, collected could be for a given user only:
user_maxCollectedCount=0
user_minCollectedCount=1
would return only stuff that I have not already collected,
or only stuff that I have collected, which could be very useful.
Okay, understood.
But we could have a min/max using the same field as the ordering?
How about the per-user counts?
Completely out of the question?
Thilo
Yes, that's reasonable and a good idea. I'll work on that.
> How about the per-user counts?
> Completely out of the question?
Give me an example.
...doug
And then, maybe playCount, rating, collected could be for a given user
only:
user_maxCollectedCount=0
user_minCollectedCount=1
would return only stuff that I have not already collected,
or only stuff that I have collected, which could be very useful.
Thilo
I don't understand your examples below, so start from scratch and try
again, if you don't mind.
But specifically as to filtering on what you have or haven't
collected, here are some thoughts...
1. You can always find out what you've collected by using /collection
and specifying your "history" collection. Unless you've turned off
history tracking in your profile, that will show you everything you've
ever collected.
2. To find out what you *haven't* collected, you have to do #1 and
then use that list to remove program IDs from the list of all
programs. (I know you know this, I'm just going through it for the
sake of explanation.)
3. I think the question you're asking is can #1 and #2 be used as
server-side filters, combined with some other ordered request. Is that
right? Is that what you're looking for? For example (using English,
which is best for this):
"Give me all the programs sorted by highest rating, with a rating
of at least 4.1, and which I have never collected before."
Hmmm...it's possible to combine sorting by a parameter (like average
rating) with a min and max value for the same parameter. In general,
combining that with other tables is what's prohibitively expensive,
and that's what's required to check your collection history. It can
get really nasty, in fact. Supposed you asked "...and which is
currently in at least one of my active collections." Now we can't
check the history collection. We have to check the union of all of
your non-history collections. We do that now when we display various
pages on the site, but that usually means only checking a max of 100
programs or so to see if they're in a collection or not. The queries
you're asking for require us to check hundreds of thousands of
programs for whether they're in one of your collections.
Again, there may be a reasonable substitute for this query, but it's
not going to be a generalized query facility.
The best thing is to keep thinking about your specific needs and give
me the queries you need to make, expressed in English. That way I have
the best chance of understanding them, and I can possibly translate
them into something that matches the scheme.
Thanks again.
...doug
> I don't understand your examples below, so start from scratch and try
> again, if you don't mind.
Sorry, that example was quite terse.
If was looking to a) search only within the programs that I have already
rated or collected, or b) to exclude those programs from the search
(and search in all other programs).
> "Give me all the programs sorted by highest rating, with a rating
> of at least 4.1, and which I have never collected before."
Yes, that would be one example.
(But I am thinking more of ratings than collection).
> 1. You can always find out what you've collected by using /collection
> and specifying your "history" collection. Unless you've turned off
> history tracking in your profile, that will show you everything you've
> ever collected.
That is great. I did not know we have this feature.
Is there a similar list of everything you have ever rated?
> Again, there may be a reasonable substitute for this query, but it's
> not going to be a generalized query facility.
Yes, I understand that.
Generalized ad-hoc queries will not work with those large tables.
The cases I am thinking of can be covered by either a join or
an anti-join (for exclusion) against the history collection or
the speculative rating history collection.
That join could also happen client-side.
Thanks,
Thilo
OK, I think we can support "Give me all the programs sorted by highest
rating, with a rating of at least 4.1, and which have never rated
before." New options to support this are in the works.
> Is there a similar list of everything you have ever rated?
There's an RSS feed for programs a member has rated. I'll probably add
this to the APIs, and I may (eventually) deprecate the RSS feed.
> The cases I am thinking of can be covered by either a join or
> an anti-join (for exclusion) against the history collection or
> the speculative rating history collection.
I can probably add an option for "in collection <#>" as this would
create a JOIN of no more than 1,000 rows. But "Except in collection
<#>" would still create a huge JOIN.
Another update to the spec will be coming soon. Thanks for your help!
...doug
On Tue, Dec 22, 2009 at 11:46 PM, Thilo Planz <thilo...@googlemail.com> wrote:There's an RSS feed for programs a member has rated. I'll probably add
> Is there a similar list of everything you have ever rated?
this to the APIs, and I may (eventually) deprecate the RSS feed.
It's standard RSS plus the use of our namespace:
http://conversationsnetwork.org/rssNamespace-1.0/
I made this as a one-off for Thilo. I'm not sure if this is the best
thing in the long term or whether we should just make it part of the
API. The latter is my tendency at the moment.
...doug
--
You received this message because you are subscribed to the Google Groups "SpokenWord.org APIs" group.
To post to this group, send email to spokenw...@googlegroups.com.
To unsubscribe from this group, send email to spokenword-ap...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spokenword-api?hl=en.