LinkedIn API, Reading groups posts issue - php

I am using Zend Framework to access LinkedIn API.
When reading posts from a group (using http://api.linkedin.com/v1/groups/[group_id]/posts:(some_arguments) together with start and count) sometimes I can load only several first posts from first page. When trying to load next page I receive empty result, but sometimes it works fine .
I can see the issue only when trying to read popular groups. It always works correctly when reading my small group or my network.
Maybe somebody has seen this issue before and knows what to do?
Thank you.

Depending on what "some arguments" are and the number of posts you're requesting, you may be running into a timeout. If you're getting information about the profiles for the people who posted, commented and/or liked the posts as well as the post information itself, it can be an expensive call on the backend.
Try retrieving fewer posts at once, or reducing the number of additional fields you're requesting, and see if that resolves the problem. If it does, please post in the forum at developer.linkedin.com and let us know about the issue, so we can make sure the engineers are aware of the timeouts.

Related

Facebook page post share count per user

I'm trying to recreate a Facebook page tab application similar to this one: https://www.facebook.com/andrewchristian/app_118098318208381
Up to now, using FQL, I plan on fetching user data (if the user liked/commented on a post) and display a list with an order based on their activity. It will be a cron running once or twice a day. The only thing I'm missing is a way to know if the user has shared any of the page's posts.
I've been digging around in the FQL tables (the link is for the stream table) for any clues but I cannot find anything to work with. Has anyone done something similar? Any other ideas on how I can fetch such information? This has to work as "per user", I'm not not interested in the total count of shares on a post.
P.S.: If there is something that counts a user's total likes/comments/shares on a Facebook Page, I'd really like to know about that as it would make my life much easier, I'm open to any suggestion!
Thanks in advance!

Why do geotargeted posts not appear in API even with accesstoken?

This has been asked before but I haven't seen a definitive answer. Hopefully someone has an answer. Basically, it seems impossible to pull any post that is geo-tageted via the API becasue it has privacy settings, that is, a country set to who can see it.
I am using https://graph.facebook.com/".$pagetoprocess."/posts?&access_token=".$att and this will pull the posts but not any posts that are geotargeted to the UK for example.
If I create an accesstoken from a user who is an admin of the page then I see all posts including geotargeted posts.
Why would this be? how can I see all posts for any page whether I am an admin or not or whether it is geo-targeted?
I would have thought that if you creaded an app in the UK and therefore had an app and secret id code from which you then generated a user access token, why would you not be able to see a post from a page geo-targeting the UK? Seems strange.
Any ideas?
Thanks
Jonathan
I would think that all posts would appear, or at least that is what it says on the api. You could try using feed instead of posts, since posts is a derivative. You might also try using:
&include_hidden=TRUE
But I'm not sure that will help.
If you have the page url, I'd be willing to see if I can play around with it in the graph explorer.

Facebook page multiple tabs with one app mystery

Please read the question carefully before you answer as it is a bit confusing.
I recently saw that Pagemodo gives the option to have multiple tabs on a single page as many times as you want which they call as "UNLIMITED TABS" in their plan options. So this means that if we want multiple welcome tabs on a page that can be done. Technically you can create only one page tab with one application. To have multiple tabs you will need multiple apps.
Now the question is how is it possible?
Even if i have multiple apps, while showing the page tab i can fetch the data about the tab from a db using "page id" as this is the only thing i have in the signed request. How do they get to know which page it is (ok we can get it from signed request) and which app it is out of those multiple apps that were created so that they render data accordingly?
Be careful your not falling for marketing speak.
Pagemodo likely manages a defined number of apps (which may be a very large number) and is allowing you to install them onto any page you manage giving you in essence unlimited uses.
The backend is all managed via end points for each of the apps and the signed request.
I found how it may be possible.
This is a nice place to get an idea of the problem i came up with:
http://forum.developers.facebook.net/viewtopic.php?id=90792
After thinking about it i came up with the following solution that though you do not have a way to get the application id till you are not authenticated using signed request or any other data provided by facebook. But you can still get it via the page tab url.
So if i have an app with tab url as: http://www.example.com/tab.php, we can pass the app id via http://www.example.com/tab.php?id=APPID
Solves the purpose pretty well.

Update database on remote server when a facebook comment is made

I want to update a no_comments row in a database exactly when a facebook comment on my site is made. I would like to do the same thing for likes as well.
I can imagine setting up a cron job that uses the graph API to periodically retrieve the number of comments and likes and update the database but for a large number of objects that are associated with comments the lag introduced is undesirable.
I am not looking for someone to "code a solution" for me...rather can someone point me in the right direction: is it possible to use AJAX to somehow update the database at the point when a comment is made or a like is done?
I can see how one can use the click event for the like button but it's not fool proof...
All help is appreciated!
Assuming you are using Oauth and have a facebook application then I would consult the facebook API docs for events or triggers. If a method exists it will be in the API docs.
Your description of your "site" is vague so it is hard to understand what your site or how it connects to facebook.
Edit:
I wish people would explain down votes. I can't fix it if I don't know what the issue was.
I followed my own advice and searched for this "facebook run script when like is clicked" on Google and found this: enter link description here This is almost the same question except it deals with "like" buttons rather than comments.
You can generate "events" like I had previously suggested. So further consultation of the FB API may be the most fruitful way of finding out if there are events around "comments" as well as "likes".
Maybe the OP knows this, but there are several APIs (last time I checked) to facebook including Javascript methods that could be used in an Ajax manner. However, without further details of their website implementation there is no way to tell.

Facebook API. Remove tags, wallposts, messages from a certain user

I'd like to remove as much as possible of my history with a certain facebook user via the Facebook API.
I want to be able to remove photo tags, wallposts, messages that I am tagged in, or associated with the certain user.
Is this possible, and if yes; how?
Blocking the user will go a long way towards removing most connections with the person in quesion. Go to Account->Privacy Settings->Manage Block Lists, or go to the users profile and look for the "Report/Block" link under their friends/family lists.
This FAQ about blocking describes a little about what happens when you block someone. As far as photos goes, it's a little unclear:
Photos: If the blocked person tagged you in any photos before the block, you’ll still be able to see those photos. You might also see photos of the blocked person if they are tagged in another friend’s album, but you won’t be able to click on their name to see their profile.
You do automatically get un-tagged from all their photos when you block someone. I'm guessing wall posts you're tagged in are removed as well, although I only tested with photo tags.
As far as removing their posts to your wall, as Igy pointed out you can't write an app that uses the API to delete posts that it didn't create. So, what I would do is write an app that gets all the posts on your wall and filters them, something like this pseudo-code:
posts = api('/me/feed')
for each post in posts:
if post.from.id == [blocked persons id]:
output post.id
Post ID's from the Graph API are in the format USERID_POSTID, so there are two ID's separated by an underscore. So for each ID in the output, go to https://www.facebook.com/permalink.php?story_fbid=[POSTID]&id=[USERID] and manually delete the post by selecting "Remove post" from the little gear menu on the top right of the post. Use the paging data from your API request, or until and since parameters (which are just UNIX timestamps, or any string accepted by the strtotime function), as described on http://developers.facebook.com/docs/reference/api/ under "Paging", to get all posts going back until the beginning of your wall.
If you are wanting to automate this process to make it available to end users and not just yourself, there are technically several ways you could go about it, although they may or may not violate (Terms of use)[http://www.facebook.com/terms.php]:
[3.2] You will not collect users' content or information, or otherwise access Facebook, using automated means (such as harvesting bots, robots, spiders, or scrapers) without our permission.
I'm sure there are ways of implementing such an app that doesn't violate these terms, for example providing a link to the post so that they can delete it themselves, rather than automatically deleting them.
http://suicidemachine.org/
I'd look into their code.
From their FAQ on if you can make your own:
Theoretically yes! Practically no (or let's say, not yet)! You'd need a Linux WebServer (apache2) with perl and python modules (php should be installed as well). Further, you'll need VNC-server and Java packages by Sun to launch selenium-remote applets. If you feel like contributing and can convince us with decent programming skills, please get in contact with us via email. We don't make the source code publicly available, since Facebook, Twitter, Myspace and LinkedIn would figure out how the suicidemachine is working in detail! So, please do not contact us, if you work for one of these companies!
I'm not even sure (personally) why you'd want to do this, surely you'd either want to block the other user or just remove them as a friend, but to answer your question:
It's not possible to delete most types of content via the API unless the App ID you're using was the original creator of that content (e.g an app for posting to your wall can delete the posts it made, but not posts made by other apps or on the Facebook.com interface)
Check the documentation at http://developers.facebook.com/docs/reference/api/ - you can definitely remove likes and comments of photos and wall posts - there may be other ways to do this (e.g retroactively changing your RSVP status to an event both users went to)

Categories