I'm building an app, and I want to allow users to integrate it with various social platforms. One of the things users can do is post a link to something they created on our site to their Facebook wall. We want to let them specify who can see whatever they post. I think this can be done but using the Facebook dialog, yes? So they can check the names of people who should be allowed to see the link and then follow it to our site.
However, this is fine from the point of view of seeing it on their wall, but we don't necessarily want other people to stumble onto it by accident, or to share it with other people. For this reason, we want to make sure that the person looking at the stuff on our site is a friend of the person who created it.
My understanding is that we can't store friends IDs if they haven't authorised our app. Can we store the id of the post in a way that lets us figure out the friends IDs from that? E.g. user makes post 5678, and specifies that people A, B and C can see it; we store 5678 and then, as it's needed, we request that post from Facebook, check whether the user trying to view the content is either A, B or C and then act accordingly?
Will that work?
Or is there a better way of doing it?
Thanks!
Related
I'm trying to create a members site using php where they can upload images (dynamically create thumbnails) and comments for all members to see. I want all uploads to be published only after admin approval.
I can do quite a lot of this (registration, login, and even basic upload)but would be grateful if someone can provide a link to any lessons or videos of how to put it all together. I really would like to learn how to do it rather than configure someone's script.
I've checked YouTube but cannot find exactly what I'm looking for.
Thanks
In order to do an approval system, I think the most simple way to do it is to have a field in a DB, for each comment, image, etc, named "approved", which can take a 0,1 or 2 as value.s
If it's 0, it means it needs approval. 1 means it's approved. 2 means it is disapproved.
Note that 2 is not really necessary. It's just to distinguish new entries from old entries that weren't approved.
Then, on the backend, you can only give access to the approval system to the admin. You can use the same approach to define admins, users, moderators, etc...
what i have to build is page that have some pages that are restricted and some are not on similar links. I`ll try to explain it on example:
Let's say that i have users in my system (based on FOSUserBundle), and each of them have own account that contains a Blog and Gallery (different controllers). Some of User want to give access to thier Blog and Gallery only for certain group of people (that are not stored in system), so they generate token (only one token, so whoever know token will be able to access area) and sends to Users. What i don`t want to do is to check it in each method of controllers.
So let`s say we have 2 users, steven and stan and first of them want to make his blog and gallery free to see, but second one want to be restricted based on token.
Link would be like this:
/steven/blog
/steven/gallery
/stan/blog
/stan/gallery
Could anybody recommend some solution or any idea how can i try to build it in Symfony2?
Why don't you want to check it into the controllers ? I don't see any others ways to do that, according you want it to be dynamic and possibly changing.
For several years i have managed to sort things out without posting my own question, but by readings others instead. However, after reading over 200 useless posts, i've decided it's time i get some help.
I'm building a facebook app, and what i wan't to do is extremelly simple to explain. I wan't to notify a certain user about some event in real-time. For example, "the tv show you want to watch starts in an hour". Unfortunately, facebook doesn't allow apps to send private messages to users (which was my first choice). The standard way of publishing on a users wall on HIS BEHALF is not good either, because no notification is triggered. Therefore, my idea is to post on his wall on behalf of the app (or any similar action that will trigger a notification).
I know about app requests, but they are not what i'm looking for either, as you can see, they do not match what i want to do.
Also please note that the event may be particular for each user, so making a post or something for EVERYBODY to see is not an option ("Peter, you have dinner with stacy in an hour").
Firstly, i want to know if posting on the apps behalf (or facebook page, or any other idea) is possible.
If it isn't, i would like to see any other ideas to sort this out. Remember, it's extremelly important to trigger the notification.
Thanks for your time reading this, but i have one last request.
Although what i want to do is pretty simple, there are plenty of similar issues being disscused, which may lead to confusion, so please be SURE that you fully understood what i am asking before answering.
Thanks again
What about opening an event and auto inviting the specific user to the event?
Events invites trigger a notification and the only thing you need is the user's email address which you can easily get.
I am not 100% sure if an app posting on your wall initiates a notification*. Although posting to a users wall on behalf of an app is certainly possible.
You can follow the instructions on this link, under the "App Login" title, and with that retrieve the correct access token you need to make calls as your app.
In order to have the functionality you specified, you'll have to request the offline_access permission from your users - this will allow you to post to your users wall even when he/she is not currently in or using your app. (or even logged into facebook)
*
Usually these posts on behalf of an app are user initiated - ie the user pressed "post to my wall."
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)
I've been building a web app that uses facebook integration for easier registration/login and notifications for the users. However, for the notifications I want to be able to post to a users facebook wall when something happens on our site.
Really I see two possible problems with doing this. First being that the user will most likely not be logged in to our website when the notification needs to happen. Second I have not found a way to post to the feed using any identity other than the current logged in user.
So to reiterate exactly what I'm trying to do. When some action takes place on my site involving Bob, I want the websites application to post on Bobs wall notifying him of the action as if the application is one of Bobs friends. From some of the things I've seen while researching this, it seems as if facebook might not treat applications like users and I might have to go through a page to accomplish what I want. But really I'm ok with that.
What you need to do is to ask for the offline_access permission. Then you can store their graph id property after they login/authorize to your site's database. Then you just post to that graph id instead of instead of /me. In your case you would then POST a request to the "$user_graph_id/feed" endpoint with whatever parameters you usually have.