Recommended way of getting student assignments in Google Classroom API - google-classroom

Trying to get all assignments for a given student but cannot find a reliable (fast) way to do it.
It seems like the only way would be:
Get the student courses via courses.list
Loop through the courses list and call courses.courseWork.list for each
Say that on average a student has 10 courses, then 10 requests have to be made. But this takes a while and is kind of overkill...
I would like to know if I am missing something, is there a better way?

I guess you are the user who posted the last comment in this Feature Request. Unfortunately the method you described is the only way.
For someone who faces the same issue, in the Feature Request, you can click on the star next to the issue number to receive updates and to give more priority to the Request.

Related

Delta handling in GoogleClassroom

We are integrating Google Classroom to sync data to our Application from GoogleClassroom.
We have the following queries :-
Let's say today we fetched data from Google Classroom and we got a Course named as XYZ".
After 1 week again we fetched the data and above retrieved course i.e. "XYZ" got deleted / inactive then it will come with type as "Deleted/ Inactive.
How long does this delete /inactive event for this courses will come. and how we can handle deltas after doing first sync.
Thanks
It's tough to understand what you're asking partially do to language. Let me see if I can understand.
Are you asking how long a course will be marked as "archived" after it was changed to archived by the user? If so, the answer should be "indefinitely."
If you're asking a different question, perhaps showing us what code you're using or API endpoints you're hitting, along with its return information, will help us understand.

Mailchimp members activity

I've got some kind of script. Goal is:
Get Mailchimp Lists
For each list get members
For each member get activity
Store it
Does anyone know - if there any way to not use one API call for each member to get his activity?
I've got around 28 000 members.
28 000 API calls - seems as bad as it can be.
I've tried to get Lists Activity, but no way, it is always empty. So I really have to get exactly members activity.
I'm currently attempting to do something very similar and there is a workaround, although I am not sure how feasible it is. Basically, you can do it through reports, email activity:
http://developer.mailchimp.com/documentation/mailchimp/reference/reports/email-activity/
The challenge here will be that you will try to pull 28.000+ records at a time, therefore it will take a long time. From my brief calculations it can take up to 1 minute per 1000 records (you will need to loop through 1000 records at a time, otherwise it will most likely time out).
The larger problem is maintaining this 'database', if you have activity constantly happening (i.e. opens/clicks/bounces) then you will need to pull the whole campaign activity again and update wherever you store it. I've been trying to find a workaround with no success. You could use the 'since=2017-10-07T00:00:00+00:00' parameter, however it still returns a blank list when there is no activity unfortunately. If only 1000 members are actually active, it will return 27.000 rows of no activity. It would be great if there would be another parameter we could potentially apply to return only emails where there was an action.
Please let me know if you find a better solution.
P.S. - it might be worth reaching out to mailchimp support for this
Update - you can use the Mailchimp Export api: https://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-the-export-api/ and extract the email activity. I had huge issues unpacking it, please follow the links below: Decode text response from API in Python 3.6 and Separate pd DataFrame Rows that are dictionaries into columns . Let me know if you have any other questions.

Get property rating from Booking.com API

I need to get the rating value from Booking.com system for specific property. Is there an API that provides information such as overall rating and other useful information for properties that are listed in their system?
In case anyone has the same question I will answer in short - the booking.com API is not public! In order to get access you need to write them an email and provide a lot of information about why you're going to use it, how and who is going to use it. Describe your business model etc. Also you need to producing an average of 500 bookings per month. Then wait an approval process.
I decided to simple parse the website and get the overall rating.

Mailchimp - How to record data to subscribers list from 2 different forms

Ho everyone, I'm in trouble with my campaign, this happened to me... when i go to my list to see the data of the recipients.
It is asking me to create a reconfirmation Campaign, due to a too high volume of unsubscribed to this campaign.
Here the path I've been following to realise my campaign ( It is the first time I'm using Mailchimp):
I have an invitation to a event where guest can approve or decline the invitation.
When they Accept the invitation: it bring to the update profile form - which icahnge in the advence editor. This way We can record some data such as dietary requirements,etc which would be recorder to our subscriber list ons submit.
When people decline the invitation, we have link to the unsubscribe form. This way we are able to know Which person has decline the invitation.
From what I understand, this is way It stopped our campaign.
What I'm looking to achieve . . . and din't manage i slept 2 hours last night trying to make this work . .. and i m in a big rush :
How can I achieve to collect data with the path explain previously, without having this issue in the future - so without using the unsubscribe from - but two different forms ?
How can I access to the List of User who have accept the invitation, so I mean the Subscriber List. because since that happen, I can't access it - and obviously i don't want to send another email to the guests asking them to fill up again.
I really appreciate all the help that anybody can provide me with that,
Thank you guys !
If I'm understanding you correctly, you're trying to use list subscriptions to stand-in for RSVPs? That is likely to look really bad -- ESPs see high volumes of unsubscribes as suspiciously spammy -- you'd be better off using Interests or Merge Fields on your list to denote the user's RSVP rather than asking them to unsubscribe. As for your current account, follow the instructions in the email you received if you want to get your list back up and running again.

Optimal algorithm to follow all Twitter users

What is an optimal algorithm to follow all Twitter users using the twitter API? I have been wrapping my mind about this issue and I cannot find any optimal iterative approach to this.
Thanks in advance for any suggestions.
Besides the case of "why would you do such a thing?" and "this will get your IP banned", etc.
This shouldn't be all that different from writing a web crawler. I would start off by finding a few root sources and throwing their follows/followers into a priority queue ordered by number of follows/followers the user has, ignoring follows/followers you've already visited. Then visit the users using the priority queue to find the user with the most new follows/followers, keeping the pq updated as you go along.
Again, this sounds like a terrible idea to implement in practice. Twitter had 190 million users in July 2010!
As long as you have a theoretical machine, so time and number of API calls doesn't matter, the solution is simple. Every user has a unique id. A user I am following who created his account last week has an id of 229,863,592, so let's use 250,000,000 as the theoretical end point. You can start with an ID of 1, and use the API to follow each user from 1 to 250000000. Anyone who has deleted their account or has been suspended will return an error when you try to follow them. The Twitter API for following 5,000 users at a time by id is:
http://dev.twitter.com/doc/post/friendships/create

Resources