How to retrieve google contact groups using url.? - google-app-engine

I am retrieving contacts groups of users. I have to show groups by pagination.
So i am doing like this,
URL feedUrl1 = new URL("https://www.google.com/m8/feeds/groups/"+userEmail+
"/full/?xoauth_requestor_id"+userEmail+"&start-index=10&max-results=5");
ContactGroupFeed resultFeed1 = contactService.getFeed(myQuery, ContactGroupFeed.class);
Above query showing results starting from 10 and showing all records.
It is not retrieving results based on max-results.
Is there is any wrong in it? What is another option for me?

I did a quick testing, and the max-results parameter is working as intended.
I have total 6 contact groups. Happy 1, Happy 2, Happy 3, Happy 4, Happy 5 and Happy 6.
This is the request I made:
https://www.google.com/m8/feeds/groups/userEmail/full?start-index=1&max-results=5
In the response, I get the parameter <openSearch:itemsPerPage>5</openSearch:itemsPerPage>, and it is only showing Happy 1 - 5 in the result.
I think if you are using the oauth_requestor_id, the URL should looks like this:
https://www.google.com/m8/feeds/groups/userEmail/full?xoauth_requestor_id=userEmail&start-index=10&max-results=5

Related

Is it possible to have not-in array using swift and Firebase Firestore

So I tried to create a page to add new friends in my IOS swift app. So, I first tried where "id" is not in AllMyFriendsIds.
db.collection("users").whereField("id",notIn: MyFriends).limit(to: limit).getDocuments(completion: { [self](snap, err) in
But with more than ten friends the program crashed. Then I tried to do where "friends" array-not-content userId but this method doesn't exist.
Here is an example of the user's docs.
Here is the code that does not work so how to get all users that are not friend with us so where friends does not contain userId or where the docId or Id is not in an array(more than 10)
db.collection("users")
.whereField("friends",notIn: [UserDefaults().string(forKey: "userId")!])
.limit(to: limit)
.getDocuments(completion: {
My goal is to get users that are not my friends with the most efficient technique. Because I know how to do it by separating into groups of 10 but this technique is not efficient with reading and writing and cost a lot.

How to create a loop to extract my Twitter followers' followers through Tweepy V2

Some of the answers on SO currently does not work with API V2. Currently, I made this Frankenstein code to extract the followers from a list of 110 users (let's call this list A users). I then want to organise my data into a dataframe so that I can see a column of list A users and next to it is the list of followers for each user. Something like this:
List_A_User_1 | List_A_Follower_1
List_A_Follower_2
List_A_Follower_3
It should take around 110 minutes (since every 15 minutes I can make 15 API calls). I am currently on Tweepy and using a Twitter developer account. However, it has been 20 hours and the code ran before the Kernel died. How may I be able to execute what I want to do?
This is the code so far:
twitter_handles = List A
twitter_handles = df['id']
new_follower_ids = []
ids = []
for user in twitter_handles:
current_user_followers = []
while True:
try:
for page in tweepy.Paginator(client.get_users_followers, id=next_users, max_results=1000, user_fields='created_at'):
current_user_followers.extend(page)
except tweepy.TooManyRequests:
print('Hit Twitter API rate limit.')
for i in range(3, 0, -1):
print("Wait for {} mins.".format(i * 5))
time.sleep(5 * 60)
new_follower_ids.extend(current_user_followers)
ids.extend([user for _ in current_user_followers])
new_followers_df = pd.DataFrame({
"IDs": ids,
"Follower_ID": new_follower_ids})

AngularJS, where to get data for every input

I built a website, where I have many dynamic elements using AngularJS and Laravel.
For example: I have 3 paragraphs, 1 about, 2 contactus, and 3 phone number
In my database I created a table where I put the description and the value. Example:
id description value
1 about_text test1
2 contact_text test2
3 phone_text 1234
I created my query in Laravel and got all the values now. Now I'm getting the response like follows:
[{description":"about_text","value":test1}.... same for all data.
Now in AngularJS, how can I get the phone text to the phone text.. the contact text to the contact us text. (I defined variables for everything of course)
Not sure if this is what you are asking for:
var text = '[{"description":"about_text","value":"test1"}]';
obj = JSON.parse(text);
var yourvar_description = obj[0].description;
var yourvar_value = obj[0].value ;
try and let me know

in Watson Discovery News Feed API, limiting articles returned by date

Per the API documentation, manipulating the vales of "start" and "end" will result in different data sets being returned. Strangely, changing the values of start and end resulted in the same result being returned. What am I missing? Thanks!
qopts = {'query': '/automotive and vehicles',
'aggregation' : '[term(yyymmdd).term(docSentiment.type,count:3)]',
'return': 'docSentiment.type,yyyymmdd',
'count': '50',
'start': 'now-2w',
'end' : 'now-1w',
'offset': my_offset}
my_query = discovery.query(my_disc_environment_id, my_disc_collection_id, qopts)
I hope it is helpful for you.
I am not sure if this is right answer for you because I have limited information.
First of all, please check the number of return-sets. if the return-set has more then 50 dataset, result could be same. (might count param. -1 = unlimited in the rest API of WCA (Watson Context Analytics)
Second, if you can check the log from the server side, you can see the full query which manipulated from WATSON engine.
Last, I am not really sure that watson REST-API can recognize 'now-2w' style start-end form. Would you please link the tutorial? In my previous project, I wrote the start-end date by Y-M-D form.
Good Luck

Cat/SubCat product count incorrect in Drupal 7-Ubercart 3

I am working on Drupal 7.12 and Ubercart 3.0 for a store website. While working on Product Categories, I am getting wrong count of items in parent category as well as sub-parent or sub-sub-parent category like:
Cat A(5)
Cat A-1(3)
Item 1
Item 2
I think there is a bug either in Taxonomy module or uc_catalog module. I have searched over the net but didn't find any perfect solution. So anybody there having any workaround for this specific problem as I have to show the count of items in front of their respective category and total in parent category.
It appears that it is not counting only product items but it is also counting category along with product items.
Thanks for your time.
Regards
pls refer to this part of code of uc_catalog.module
$query->entityCondition('entity_type', 'node')
->entityCondition('bundle', $types)
->propertyCondition('status', 1) // Don't include unpublished products.
->propertyCondition('language', array($language->language, 'und'))
->fieldCondition('taxonomy_catalog', 'tid', $branch->tid)
->count();
$num = $query->execute();
the above is an example to count only the nodes with und(neutral language) and current language. This is the deficiency of the ubercart.

Resources