I am retrieving streams from the https://api.stocktwits.com/api/2/streams/symbol/:id.json endpoint, but so far I have been getting the latest 30 posts. I'm wondering if it's possible to specify a date in the past to get posts for that date, or a range of dates.
Related
I need to get daily uploaded videos in a playlist so thought to get videos for a playlist sorted by published date.
So is there any option to pass published date while fetching data for playlist?
I tried 2 options
option 1 )
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=15&playlistId=PLP-nGFpz3fa_boeLhG4m0Ie_8vmCvp5oH&key={YOUTUBE_API_KEY}
does result return from this URL is in sorted order? I found its not in sorted order.
Can I pass some date parameters related to date in this or some sort related parameters?
option2 )
I tried using "Youtube Search API"
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list
here we have date option but only can pass channelId not playlistId.
So can we pass playlistId in search API to get all videos for playlist?
Is there any other way which I can use?
Thanks
The PlaylistItems:list does not have any way to order results - the playlist order is returned in the order specified by the owner. Nor does Search:list allow you to specify a playlist.
Does the playlist owner add new videos to the beginning or end of the playlist? If the beginning, you could try fetching the first X videos and comparing the publish date to the current date.
Looking at the guide using Videos.list, nowhere does it mention that this feature is available, where the list is readily sorted upon return of the response body. Try putting the results in a container first where you will implement your own comparison of dates to sort the items. This SO thread seems to confirm this.
Due to the PowerShell methods of getting mailbox statistics from Office365 taking about 2 seconds per mailbox, I am working on getting the data from Office 365 Reporting web service, which takes only a few seconds for each 2000 mailboxes.
The problem I'm running into is that the stats are updated periodically and some historical data is kept, so there are numerous records for each user. I only want to get the latest record for each user, but I haven't been able to find a way to do that. The closest I've come is to use $filter=Date ge DateTime'2016-03-10T00:00:00' where the date is concatenated to a couple of days ago. Theoretically, if I sort by Date desc I should get the latest records first, and if there is a user that has a record for 3/10 and 3/11, the 3/11 record would get pulled first, which would work for me. But regardless of how I do the sort it seems to come back with the older records first.
Ideally, I would like to be able to set criteria so that it only returns the latest record for each mailbox, but I can't seem to figure out or find how to do that. The closest I've been able to come is to just start running queries filtered on specific dates, walking the date back a day on each query.
If I can get the latest records to be returned first, I would be able to work with that because I can just discard a record if I've already received a later one.
https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MailboxUsageDetail/
?DelegatedOrg=nnn.onmicrosoft.com&$select=Date,WindowsLiveID,CurrentMailboxSize
&$filter=Date ge DateTime'2016-03-08T00:00:00'&$orderby=Date desc
So the questions are:
Is there a way to specify criteria so that only the latest record for each user is returned?
Is there a way to get it to order by Date descending--what am I doing wrong with the $orderby?
Thanks!
You can use $top=1 to get latest record by applying $orderby on date (desc). $filter and $skip may not require in this case.
https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MailboxUsageDetail/?DelegatedOrg=nnn.onmicrosoft.com&$select=Date,WindowsLiveID,CurrentMailboxSize&$orderby=Date desc&$top=1
Your query looks fine, here is an another example from Odata sample service to get employee detail with most recent birth date.
http://services.odata.org/V4/Northwind/Northwind.svc/Employees?$select=EmployeeID,FirstName,LastName,BirthDate&$orderby=BirthDate%20desc&$top=1
Given the uploads playlist of a channel I can query the playlist using playlistItems.list. Querying for snippet gives us publishedAt. However the publishedAt date does not match up with querying each video individually or the time on the web client. The time given by querying the video itself matches up with the time given by the website. Also the returned videos are ordered by this date however this is not the order given on the actual channel.
What does this time represent and is it possible to get the uploads playlist ordered by (actual) publish date?
From the playlistItems documentation:
snippet.publishedAt
datetime The date and time that the item was added
to the playlist. The value is specified in ISO 8601
(YYYY-MM-DDThh:mm:ss.sZ) format.
This differs from the publishedAt value for videos.list, which gives you the actual date it was published. If you wanted the videos in the actual order they were uploaded, you'd have to get the ID of each video in the uploads playlist, then the videos.list publishedAt value for each one, then put them in order.
Since Twitter Search Api 1.1 does not have since parameter to specify the start date, how do I get the tweets between 2 different dates(within 7 days limit)?
Note: I cannot use the since_id and max_id as parameters because I have only 2 dates and search query as inputs.
There is no direct way of doing it, but here are couple of ideas. You have a from date and a to date, right? So -
Set result_type to recent and until to your to date and count to 100.
from the result of 1, you get 100 tweets and you check if you've hit the from date, if not keep going till you reach from date using the max_id parameter.
Another idea would be -
Set result_type to recent and until to your from date. get the ID of the latest tweet from there. You need all the tweets since that ID till your to date ends.
So you set since_id to that ID you got in step 1 and keep requesting and updating since_id after each request till you hit your to date's end.
You can use since_id & max_id to fetch tweets between a specific ID.
I want to know how to fetch tweets posted within the last three months, but I don't know how to find the tweet ID, which was posted before three months.
The twitter api has the search call method. You're already using since_id for the ids, but it looks like you want to use dates as well.
The two date methods (year-month-day) are:
hashtag since:1988-06-28 - Searches for "hashtag" and sent since date "1988-06-28".
hashtag until:2013-07-12 - Searches for "hashtag" and sent before date "2013-07-12".
Those two date examples (apart from the actual dates) are plucked straight from the documentation. If you want the last three months, just:
Calculate three months past to the following format: YYYY-MM-DD.
Use that in the since query
As of today, three months past is: 2013-04-12
since: 2013-04-12 - would be what you require in your GET request. Documentation Link.