Closed liudr closed 6 years ago
1) The offset & limit params should take care of this. Check out: https://github.com/sparkfun/phant/pull/85
2) Check out: https://github.com/sparkfun/phant/pull/90 for filters & https://github.com/sparkfun/phant/pull/91 for timezone conversion. The timestamp field can be queried using strings similar to PHP's strtotime
. i.e. ?gt[timestamp]=now%20-10%20minutes&timezone=America/Denver
3) Great idea, but what about something like this: Currently streams have metadata (stuff like title and description) & logged data (what you see when you request output). What if I allow users to create/update/delete their own custom metadata values, and keep that separate from the logged data so they can use the metadata to control devices if needed. My gut says that the key/value expiring is probably something that should be handled by the client with a delete request, but I could be convinced otherwise.
Thank you Todd! I am finding #85 very useful already. Will read #90 and #91. About the user-defined metadata, allowing users to create/update/delete will be awesome! I wonder as a data logger sending data, how to get the metadata, by requesting metadata or by looking into HTTP response header? I'm pretty new to this stuff.
I'm guessing the metadata stuff would be a different request, and it could have its own REST interface.
Thanks. Will metadata stuff be available some time soon?
Another thought: For the meta-data pair issue, we can also make a separate stream for commands. Maybe the user posts a command to this stream and the logger periodically retrieves the latest command to compare with time stamp to decide whether to execute it.
I am new to GitHub. Collecting some data with my Arduino and Phant. Seems this thread answers some of the questions about what I would like to do. However I am not able to access any of the examples. Any suggestions how to see the examples in thread #85?
stil190,
Do you mean an http address sample such as
http://data.sparkfun.com/output/YGv7gG4M6RfwY8d8LapN.csv?limit=10&sample=4
That's one of my streams. You're welcome to take a look but please create your own stream for more testing with #85 issue related options. I'm using this stream quite frequently.
Thanks
I would like to see how you put the filters (ie... Limit) into the Ajax statement. I am unable to open the links in 85.
Hope this makes sense. Thanks for ur reply.
Sent from my iPhone
On Dec 11, 2014, at 7:28 PM, liudr notifications@github.com wrote:
stil190,
Do you mean an http address sample such as
http://data.sparkfun.com/output/YGv7gG4M6RfwY8d8LapN.csv?limit=10&sample=4
That's one of my streams. You're welcome to take a look but please create your own stream for more testing with #85 issue related options. I'm using this stream quite frequently.
— Reply to this email directly or view it on GitHub.
You mean ajax calls like this?
var jsonData = $.ajax({url: 'https://data.sparkfun.com/output/' + public_key + '.json',
data: {limit: 10, sample: 4},
dataType: 'jsonp',
})
Replace public_key with your own public key.
Thanks. That is exactly what I was needing to understand. Appreciate the help. From: liudr notifications@github.com To: sparkfun/phant phant@noreply.github.com Cc: stil190 shepherd_joe@yahoo.com Sent: Thursday, December 11, 2014 11:24 PM Subject: Re: [phant] How do we request a specific amount of data from phant? (#126)
You mean ajax calls like this? var jsonData = $.ajax({url: 'https://data.sparkfun.com/output/' + public_key + '.json', data: {limit: 10, sample: 4}, dataType: 'jsonp', }) Replace public_key with your own public key.— Reply to this email directly or view it on GitHub.
Unfortunately Phant, our data-streaming service, is no longer in service and will be discontinued. The system has reached capacity and, like a less-adventurous Cassini, has plunged conclusively into a fiery and permanent retirement. There are several other maker-friendly, data-streaming services and/or IoT platforms available as alternatives. The three we recommend are Blynk, ThingSpeak, and Cayenne. You can read our blog post [ https://www.sparkfun.com/news/2413 ] on the topic for an overview and helpful links for each platform.
Phant is great for uploading. It's simple and elegant. On the other hand, how about make a simple elegant data retrieval method such as retrieve according to a few criteria: