AirQualityEgg.com Product ID and API Key?

119 views
Skip to first unread message

Mark Silverberg

unread,
Mar 28, 2014, 11:15:45 PM3/28/14
to airqua...@googlegroups.com
Trying to grab data for publicly accessible sensors (much like airqualitydata.com (source code at https://github.com/xively/airqualityegg.com) for a study but it seems I need the product ID and API key(s) for Xively. Is this available?

Thanks,

Mark

Message has been deleted

Adam Laskowitz

unread,
Mar 29, 2014, 8:36:36 PM3/29/14
to airqua...@googlegroups.com

Hi Mark,

What you can do is search Xively for either username or tag (both should be airqualityegg I believe). It's been a while since I've done anything with this, but when I was this worked for me fine. I was using the Cosm API, although that REST url still works, I assume it works with the Xively API. I was sending a JSON request via javascript and the "username" tag search "airqualityegg" gets all eggs from Xively.

Hope that helps.

Message has been deleted

Victor Aprea

unread,
Apr 1, 2014, 7:51:13 PM4/1/14
to airqua...@googlegroups.com, ma...@socialhealthinsights.com
Mark,

I want to applaud you for taking up the gauntlet on this issue! I have a test case for you that doesn't seem to be working. https://xively.com/feeds/341814768/ has a location associated with it, but doesn't show up on the map on your fork site. I think it should be showing up west of Fredrick, Maryland (where it is displayed on the Xively site). Any thoughts on why? My theory is that the Xively query mechanism is fundamentally limiting the number of eggs returned, and some kind of progressive background query is needed in Javascript to really get all the Eggs onto the map, but this is not my forte. I'm happy to do a pull-request on your behalf to the xively.com repository and Levent Ali has previously said he is willing to do the actual deployment to the production site as needed. 

Regards,
Vic

Victor Aprea // Wicked Device


On Sat, Mar 29, 2014 at 8:40 PM, Mark Silverberg <ma...@socialhealthinsights.com> wrote:
Thanks Adam. I eventually figued it out and have been enhancing the site from my own mirror at http://airqualityegg.askopendata.com/ - If whoever is in charge of the main site wants to merge, feel free to just look at my fork and ask me any questions you might have.

Mark

--
You received this message because you are subscribed to the Google Groups "#AirQualityEgg" group.
To unsubscribe from this group and stop receiving emails from it, send an email to airqualityeg...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Silverberg

unread,
Apr 1, 2014, 8:10:17 PM4/1/14
to airqua...@googlegroups.com, ma...@socialhealthinsights.com
Vic -- thanks for the feedback! I've got news but it's confusing. When I do a search for device:type=airqualityegg (this is what airqualityegg.com does), I get 908 Xively feeds that do not include the feed you mentioned. When I change the query to use user=airqualityegg as Adam mentioned earlier in this stream, I get 907 feeds including that feed. This is my first exposure to Xively but as long as you all are not planning to let people register their own xively feed and instead continue to use one "airqualityegg" feed, it sounds like searching by user might be better.

Let's figure out this "issue" before doing a pull request. I can definitely change the rest of the code base to use the find-by-user route if that's what you and others decide is best.

Mark

Victor Aprea

unread,
Apr 1, 2014, 11:56:53 PM4/1/14
to airqua...@googlegroups.com, ma...@socialhealthinsights.com

Honestly I'm not even sure how that device:type=airqualityegg tag happens. Something about Xively device templates or something associated with provisioning?

Fwiw, there are actually 958 or so activated Eggs according to the Xively management interface, and 1261 registered Eggs.

I agree with getting a better handle on the problem before doing a pull request.

Thanks again for your help!

Vic

Mark Silverberg

unread,
Apr 2, 2014, 8:47:45 AM4/2/14
to airqua...@googlegroups.com, ma...@socialhealthinsights.com
Interesting regarding your numbers.. My outside opinion is to filter on user (aka creator) but will standby for a more final decision. Take care!

Sent from my iPhone
You received this message because you are subscribed to a topic in the Google Groups "#AirQualityEgg" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/airqualityegg/I7PkGmBBk_o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to airqualityeg...@googlegroups.com.

vicatcu

unread,
Apr 2, 2014, 10:23:21 AM4/2/14
to airqua...@googlegroups.com, ma...@socialhealthinsights.com
Do you think it's possible do a progressive query using javascript? I really think that a single query will never get all the results, independent of which filter mechanisms are used.

Regards,
Vic

Mark Silverberg

unread,
Apr 2, 2014, 11:35:28 AM4/2/14
to airqua...@googlegroups.com
My fork of the code isn't using a single query- it gets 100 per page until there are no more results. It does this server side and then caches them all at all_feeds.json this way the web browser never knows the API keys. I'm confident we're getting all the devices xively is letting us fetch

Sent from my iPhone

Victor Aprea

unread,
Apr 2, 2014, 11:47:59 AM4/2/14
to airqua...@googlegroups.com

Cool,  does it check for error responses from Xively API and retry on error. I've seen it  respond badly with an error message in JSON when consecutive queries are issued. The need for a lot of retries was why I thought client-side iteration might be a more tractable solution.

Kind Regards,
Vic

Mark Silverberg

unread,
Apr 2, 2014, 11:57:51 AM4/2/14
to <airqualityegg@googlegroups.com>
So I used to get a 500 error when I reached page 10 (I'm seeing 908/907 depending on my query) but I tweeted at them and they seemed to fix it. Now I get empty result sets for page 10 making me think it's working and giving me all the feeds depending on my query  

In your admin console are you able to see of it's counting only ones where creator/user is airqualityeggs? Really stumped about the discretion between 958 and 907. Perhaps not all 958 are mapped? I could start a list on the site of unmapped ones...

I think we should maybe be discussing this on github but it's up to y'all 

Mark

Sent from my iPhone
--

Victor Aprea

unread,
Apr 2, 2014, 12:16:43 PM4/2/14
to airqua...@googlegroups.com

Happy to move the conversation to Git-Hub, but it would seem that capability is disabled in the xively repo. I'd just as soon keep it going here for continuity and though.

On the back end it's pretty clunky. As user airqualityegg I go to https://xively.com/manage/somerandomcharacters?activated=true&per_page=900

And that works (lists egg serial numbers in tabular format) sometimes and sometimes it gives an internal server error. Instead of 900 using 250 or less seems to work consistently.

I don't know what mapped=true means, I don't see it documented in the REST API anywhere.

Regards,
Vic

vicatcu

unread,
Apr 15, 2014, 6:50:46 PM4/15/14
to airqua...@googlegroups.com
Mark,

I've created a Pull request to the Xively repository here: https://github.com/xively/airqualityegg.com/pull/5. The pull request is almost exactly your current master branch, so hopefully it just works :-). The ball is in Xively's court to accept the pull request and deploy the update at this point. Thanks again for making this contribution, it's a big help!

Warm Regards,
Vic

Mark Silverberg

unread,
Apr 15, 2014, 7:01:46 PM4/15/14
to airqua...@googlegroups.com
So you all rely on xively for the airqualityegg.com site upkeep? Do they sponsor anything else? Just curious as a member of the community. I know y'all have been using them for much longer than the current name :)

Sent from my iPhone
> --
> You received this message because you are subscribed to a topic in the Google Groups "#AirQualityEgg" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/airqualityegg/I7PkGmBBk_o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to airqualityeg...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages