View
 

Social Actions API - Frequently Asked Questions

Page history last edited by JoeSolomon 17 years, 1 month ago

This page is designed to highlight common or practical questions and answers about the Social Actions API. Got a question(s)? Feel free to share 'em in the Social Actions Developers Group!

 

Since there is a limit parameter in the API shouldn't there also be a page parameter? It would be nice to be able to retrieve all search results successively if desired.  -Björn

 

Yes, add page=[num] to your query if you want something other than page 1.  -Jason

 

Are the keys in the urls: http://socialactions.net/kwF permanent or will they expire after db cleanups/archiving? - Yannick

 

We currently don't expire actions and thus they are "permanent." Expiring actions will at some point become a necessity, and we will have to readdress the permanency of these "slugs" (as we call them) at that point. I should also point out that the slug is based on the primary key of the action's entry in a table, so to the extent that MySQL doesn't allow a particular key to be used again, it isn't likely it will be. - Jason

 

is it possible to send the API a blank query (or all type one), such as to satisfy a query that wants all actions from a selected category in the last seven days? - Adam

 

Yes. - Jason

 

Do you have any sort of affiliate/click-through statistics? Is there a way to track how many people actually click on these links so we can know how popular is your service with our users? - Jure

 

Jason: "For each action, we know how times it as clicked, and from where it was clicked. There are times when we can't capture the referrer, and this is mostly due to standards that don't allow it. For example, if a referrer is an SSL page, it isn't send with the request and thus we are unable to capture. 

The search results on the Social actions page will display the hit count for each action, as well as the referrer count. The JSON feed will also contain this information in the "hit_count" and "referrer_count" fields.  We currently do not publicly provide a list of referrers, but the information is captured when possible....

 

We also created a feature in the short url system that we're currently not yet using (and may need to some tweaking to get used) in that we can create a specific short url for a given source/action and thus tracking that action's hit count would in effect be what is being asked for here. " - Jason

 

Can you explain how to add / modify / delete new feeds from the system? 

 

Currently, this is a manual process. We'd like to see an admin page within the application that does this eventually. But here goes: 

 

There are three files (off the root of the Social Actions Rails application) that need to be aware of for adding a feed. They are: 

spec/fixtures/sites.yml 

spec/fixtures/feeds.yml 

spec/fixtures/action_types.yml 

To demonstrate what to do, we'll use an example. Let's say we're adding 

http://www.change.org/giving_networks/rss to the system. First, we open 

up spec/fixtures/sites.yml and add this entry (unless there already is a 

change.org entry): 

change_org: 

   name: Change.org 

   url: http://www.change.org 

Then we'll make note of the header string ("change_org") and open up 

spec/fixtures/feeds.yml to add this entry: 

change_org_giving: 

   name: Change.org Giving Networks 

   url: http://www.change.org/giving_networks/rss 

   tag_finder: "<br />Tags: ([\w\s,]+)<br />" 

   location_finder: 

   last_accessed: <%= 1.day.ago %> 

   site: change_org 

   action_type_id: 1 

   donations: false 

Notes on fields: "tag_finder" is a regular expression used to search 

feed items for tags, "location_finder" can be left blank for now as it's 

currently not being used, "last_accessed" can be left as is, "site" is 

the header string from the sites.yml file, "action_type_id" comes from 

the action_types.yml file and "donations" indicates whether this feed 

supports the "Donate Now" functionality. 

Once you are done editing the files run the following from the 

Rails root directory: 

"rake spec:db:fixtures:load RAILS_ENV=production 

FIXTURES=feeds,sites,action_types" 

To see the new data, run the feed fetcher: 

"script/runner 'Feed.fetch_all(:all => true, :debug => true)'" 

And then: 

"rake ultrasphinx:index:update" 

NOTE: When we do this, we do it in our locally pulled versions of the 

application, and after testing we check in the changes and promote them 

to the live site, performing the above rake tasks again in live. 

Promoting the site to live is not covered here. - Jason

Comments (0)

You don't have permission to comment on this page.