Xcode 6: parse online calendar - objective-c

I am currently creating an app, in which the user is able to book devices (which are provided by a json file) for a certain time period (start date - end date). I was planning to use a online calendar, such as http://30boxes.com/welcome.php to check if the requested device is currently in use by another user at this period of time.
What might be the best strategy to parse that online calendar?

just noticed this website has an API, which makes it super-easy to set and get the calendar data. I feel stupid right now: http://30boxes.com/api/

Related

How to get liveBroadcast Schedule time using channel ID

I am working with youtube data api and trying to get Live Broadcast schedule time not publish time.
Example
Apr 10, 2022
ScheduledFor more details image attached here
Please answer the relative answer if you know your answer will be highly appreciated.
I don't think it's possible with the YouTube Data API.
You could use the "search" endpoint for retrieve the "upcoming" videos from a given channel - see example - and then use another tool for extract (i.e. web scraping) the videos obtained from the previous search request for get the values "scheduledStartTime" and "startTimestamp" in the embed javascript code - both contains the scheduled time in UNIX and Date Time value respectively.
Also, check in Issue Tracker if there is an official response.

Writing Rules both in Firebase and in your Code

Firebase suggests we write security rules in both our firebase rules section online at their console for (database/storage) in addition to the rules that we have in our code (swift/java, etc). Why is this? I feel like this would be repetitive?
This is very common in a client-server architecture.
The server must validate the data to ensure that no invalid/corrupt data every gets written to the database.
The client should validate the data to give the user the best experience.
Think of an example here: say that you have a travel site where the user selects the start and end date of their journey. A common validation will be that the end date cannot be before the start date. In Firebase database security rules this could be:
{
"journeys": {
".validate": "newData.child('startAt').val() > now &&
newData.child('endAt').val() > newData.child('startAt').val()"
}
}
We did an extra check here, you can also not book travel before now. This is much simplified, but hopefully illustrates the server-side aspect.
On the client-side you'll typically show a calendar. When the user opens that calendar, you want to ensure they can't select dates before today. You'll also want to ensure that the end date can only be after the start date. If you've ever used a travel site where this last bit wasn't implemented, you'll know how annoying it it. Annoyed users go to other sites.

How to sum scheduled work hours for a user?

I wonder if it's possible to sum up a user's scheduled work hours?
I have customized the user entity and added a field that I want to show the user's total defined work hours in for the current week. But I don't know how to access the entity containing work hours. The problem is that I'm in an online organization and I can't access the database.
I've tried downloading SDK and of course googling. Since I'm a beginner I haven't found anything useful.
I've found an example for selecting time spans of working hours of a certain user. It's found in the SDK but, given that the example is written as a console application in C#, it might be perceived as complicated an unnecessarily complicated.
Also, it's mentioned that there's a field on the user entity, I assume that for this particular task, JavaScript might be more suitable and such an example I haven't seen.
This page presenting the source code is on MSDN. The bottom line is that you create a service and then execute the below.
QueryScheduleRequest scheduleRequest = new QueryScheduleRequest
{
ResourceId = GetRegardedUserId(),
Start = DateTime.Now,
End = DateTime.Today.AddDays(14),
TimeCodes = new TimeCode[] { TimeCode.Available }
};
QueryScheduleResponse scheduleResponse
= (QueryScheduleResponse)_serviceProxy.Execute(scheduleRequest);
For more information on how to handle the requests to scheduling and working hours see this article and for service appointments look over here.

Trello: how to generate an activity report using card list change dates

In an effort to unify and automate my activity report across multiple projects I am trying to generate a timeline-like report from several Trello boards.
An event on the timeline would be generated when a card is moved into the "Doing" list, with the time of list change as the start date.
The end date stays at the current date until the card is moved to the "Done" list at which point it's set to the date on which the activity was completed.
I've looked at some tools to connect Trello activity to Google Calendar, so far with no success:
Trello powerups: only provides due dates when connecting to the calendar
IFTTT - doesn't seem to provide Trello as a recipe source
Zapier - Only provides due date and last activity dates as source values
Ducksboard - No template available for this kind of visualisation
Ideally, an "API catalyst" like the ones listed above would be the best solution, alternatively any other suggestion on how to approach the problem using other tools is very welcome (I have a little experience with d3.js).
Just do it yourself with their API, you can check the guide.
Here's my algorithm for a similar task where I show which cards were having that user as a member, so basically it's like "which cards have I been working on yesterday?" report.
Connect Trello SDK;
Authorize user (only read permissions) when he clicks a button (so the popup doesn't get blocked);
Fetch /tokens/[token] endpoint to figure out the user's memberID;
Fetch /members/[memberID]/actions for a required period filtering only by addMemberToCard,removeMemberFromCard actions;
Run a loop over resulting array to figure out datetime difference between addMemberToCard and removeMemberFromCard for every card in the response;
Format everything and show to the user!
As an example, here's my realization of it: Trello Activity Report
Code is here: https://github.com/pistonsky/trello-activity-report
P.S. Instead of using addMemberToCard and removeMemberFromCard action types, you can filter by updateCard:idList and calculate the datetime difference between when card is moved from To Do to Done list.

Can you get the exact date a user started following another using the twitter API?

Let's say user A follows user B, and B follows A. I want to know the exact date A started following B and viceversa.
Is this information stored on twitter? Can I retrieve it using the API?
To clear out: The point of this question is finding a way to know who followed who first.
(I'm assuming both A and B deleted the notification e-mails)
No Ignacio, you can't. You just can know who follows who but not the date the follow started.
Looking at the API, there's is no way, there are two calls to get the followers:
User Methods/statuses/followers
and
Social Graph Methods/followers/ids
Neither of them returns dates or even a serial that would let you see who started following first. Really, there's no indication that twitter is internally storing this information, neither in the API nor Twitter's web interface.
This is a very old question, but perhaps some might be interested to know that while you cannot get the date at which someone started following, you can at least infer an "earliest possible following date" from the fact that the list of followers is ordered according to date, and the fact that follower objects come with a created_at timestamp.
Here's a Python function for calculating an "earliest possible following date": https://github.com/BernhardClemm/twitter-follow-dates
Of course Twitter stores it, because Twitter sorts followers and following lists by the date ;)
It is possible to do this, but impractical. When you call the followers API you can page the results. Each returned object contains next_cursor and prev_cursor items. These refer to the first and last records in the next and previous pages. These values are time based and can be used to calculate the time that the respective users followed you.
It follows that, if you set the page size to 1, you can walk through the list of follower IDs one at a time and the next_cursor value will allow you to derive the follow time for the next record.
This is reasonably simple to implement, however, in practice, you'll very quickly hit Twitter's API rate limit.