I am using the Python Gdata API to manage Google Groups for my organization and am interested in using the "Disable Group" feature that is now available in the "New" Google Groups. Is this feature supported in the API?
I am using the methods listed on this page:
http://gdata-python-client.googlecode.com/svn/trunk/pydocs/gdata.apps.groups.service.html
I appreciate any help given.
Edited:
I don't think it is possible via Group Setting API.
The description for disabling a group is below:
"Once disabled all new posts to the group will be rejected. Old messages will be browseable and searchable online by anyone that has permission to view the group's content. If this setting is reverted, 'Who can post messages' will automatically be set to 'Managers only' in the 'Basic permissions' section."
I try to use the group setting API and change the setting from all in domain can post to just all manager can post to limit the posting of the group.
"whoCanPostMessage": "ALL_IN_DOMAIN_CAN_POST" -> ALL_MANAGERS_CAN_POST
Note if you take a look at the basic permission for a disabled group, it unchecked all the users who are allowed to post. However, the group setting APi only limit to you change to ALL manager can post.
So it didn't really disable a group...
Related
As an Admin of a closed Facebook group, I'm trying to fetch the reactions on the posts contained within. I've tried using the Graph API explorer but I simply cannot get it to return any results using a user token. I'm using these endpoints:
https://developers.facebook.com/docs/graph-api/reference/photo/reactions/
I've tried using the above photo reactions endpoint, and also the insights endpoint with post_reactions_like_total:
https://developers.facebook.com/docs/graph-api/reference/v3.2/insights#availmetrics
I've used in the address bar:
20728370730XXXXX_22114053XXXXXX/reactions
But nothing seems to work. Does anyone know the best way to go about this or what I'm doing wrong? Thanks for your help!
You cannot use those APIs on Groups. Groups access via Apps (including APIs) were severely limited after all of the Facebook privacy issues.
The only things you can do via groups are using the Groups API which is a collection of Graph API endpoints for groups.
You can get post information and posts with personal information removed. I’m unsure if you can get reactions on the posts, but you can get the text and ID.
Only the total reactions count seems to be available:
{group-id}/feed?fields=message,reactions.summary(1)
https://developers.facebook.com/docs/graph-api/reference/v3.2/object/reactions says,
for [post] nodes, /reactions doesn't return a profile except for the current user, if read with a user access token
So if you reacted to any post yourself, you should be able to get that reaction, with your own user token - but everything else does not seem to be exposed to you via API any more.
(Other services might have special access, or they are probably just scraping the data.)
I have found lots of information on the internet about adding Members to a Group in Googlegroups, but I cant manage to get any of it to work.
I am working in Python-DJango.
Using a bussiness account, I manage to add them using Provisioning API, but I could not do it with the new Directory API.
The problem is the group I want to add people to is not a business one, it's an ordinary googlegroups one:
group_name#googlegroups.com
From what I have found, and what I did for the business group I have the following code:
groupClient = gdata.apps.groups.client.GroupsProvisioningClient(domain=domain)
groupClient.ClientLogin(email="user#gmail.com", password="xxx", source='apps')
groupClient.AddMemberToGroup("group_name#googlegroups.com", "newUser#gmail.com")
I wanted to know what I have to put in the domain field. With the business account it was the business domain, but being a normal googlegroups one I am not sure. I have tried googlegroups.com and doesn't work, as I always get a invalid domain error.
Any help would be appreciated
Thanks!
The Provisioning API (deprecated) and the new Admin SDK are both designed to work with Google Apps for Business and EDU and only work against Google Groups for Business (groups with a custom #yourdomain.com address).
You cannot use these APIs with consumer Google Groups that have #googlegroups.com email addresses. For these groups, your only option is to manage membership via the web interface.
I'm trying to make a website that allows you to setup a photo gallery with a custom domain name.
Users of the site don't know how to register or configure domain names, so this has to be done for them.
User enters desired domain name in a box (we check if it's available) and click 'register' button and our website registers the domain name for them and sets up the website automatically (when user goes to that domain name, the photo gallery just works, no technical skills needed).
Enom has an API for resellers which could let you automatically register a domain on behalf of a user. (I have no affiliation with eNom, nor have I used eNom's products).
Implementation of *.weebly.com
Typically this form of dynamic sub-domaining will use a Wildcard DNS record. This type of record maps a wildcard pattern like *.example.com to one or more servers.
Let's say you have a blogging site and want to let users choose domain names dynamically. You put up a webpage on www.example.com with a form to let user's select names. So a user signs up and chooses bar.example.com.
Suppose your DNS server has the following mappings:
foo.example.com > 1.2.3.1
*.example.com > 1.2.3.2
Any request for foo.example.com will route to 1.2.3.1, but any other name, such as bar.example.com, will be served by 1.2.3.2. So when the user is redirected to http://bar.example.com the browser will hit 1.2.3.2. Note that since no DNS changes needed, there is no propagation delay: the redirect will work instantly.
The software running on 1.2.3.2 would then examine the Host header in the request, parse the fqdn and strip off .example.com, and resolve bar against a database. If a record exists, it will serve up the appropriate response for bar.
You'd also want to keep a list of reserved names or patterns you plan to use in the future, like www\d*, mail\d*, ns\d*, so that when a user tries to register the site www07 your blacklist will reject it.
Mapping any domain to bar.example.com
Once the bar.example.com site exists, the user may want to map a custom domain name like www.widgetsimakeinmyhome.com to their site. The registration and setup for this is mostly manual, and sites like EasyDNS make it pretty simple. Some registrars may have APIs to make part of this easier for you. These should typically be RESTful or at least HTTP-based APIs, so you can choose which client library you like to use (e.g. urllib2).
To create the mapping, your database would have a table mapping primary sites like bar to one or more domain aliases. A person would sign-in and map www.widgetsimakeinmyhome.com to bar.
Now your software needs to check the Host header against both the primary site table and the alias table to resolve to the correct site.
There is no general API for this. You have to check back with your own domain registration organization. This is specific to the related domain provider.
I would recommend http://www.zerigo.com/managed-dns ... a managed DNS api solution. I noticed this service existed when a large website provided mentioned something about them. I'm thinking about using them in my next project (similar setup to what you want) and using eNom for domain registration.
Usually you register a domain via a registrar. These companies often provide proprietary APIs which you can use to do this in an automated way. (Some registries also allow registration without using a third-party registrar, for example DENIC)
The registrar then orders the domain at a registry specific to the top level domain. For the communication between registrar and registry the Extensible Provisioning Protocol was created.
Some registrars also implement EPP as an API for their customers so in theory you could use this protocol and switch to another registrar without having to use a new API. I have not done this yet so maybe you have to make adjustments when you actually switch registrars.
I am building a website for a comedy group which uses Facebook as one of their marketing platforms; one of the requirements for the new site is to display all of their Facebook events on a calendar.
Currently, I am just trying to put together a Python script which can pull some data from my own Facebook account, like a list of all my friends. I presume once I can accomplish this I can move to pulling more complicated data out of my clients account (since they have given me access to their account).
I have looked at many of the posts here, and also went through the Facebook API documentation, including Facebook Connect, but am really beating my head against the wall. Everything I have read seems like overkill, as it involves setting up a good deal of infrastructure to allow my app to set up connections to any arbitrary user's account (who authorizes me). Shouldn't it be much simpler, given I only ever need to access 1 account?
I cannot find a way to retrieve data without having to display the Facebook login window. I have a script which will retrieve all my friends, but it includes a redirect where I have to physically log myself in to Facebook.
Would appreciate any advice or links, I just feel like I must be missing something simple.
Thank you!
Just posting up my notes on the successful advice, should others find this post;
Per Daniel and William's advice, I obtained the right permissions using the Connect options. From William, this link explains how the Facebook connection works
https://developers.facebook.com/docs/authentication/
This section on setting up the actual authentication was most helpful to me.
http://developers.facebook.com/docs/api
Basically, it goes as follows:
Post a link to the following URL. A user will need to physically click on it (even if that user is just you, the site admin).
https://graph.facebook.com/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=http://www.example.com/HANDLER
This will redirect to a Facebook login, which will return to http://www.example.com/HANDLER after the user authenticates. If you wish to do more than basic reads and news feed updates you will need to include this variable in the above link: scope=offline_access,user_photos. The scope variable just includes a comma separated list of values, which Facebook will explicitly tell the authenticating user about during the login process, and they will have to OK. Most helpful for me was the offline_access flag (user_photos lets you get at their photos too), so I can pull content without someone logging in regularly (so long as I store the access token obtained later)
Have a script located at http://www.example.com/HANDLER that will take a variable from the request (so facebook will redirect to http://www.example.com/HANDLER&code=YOUR_CODE after authentication). Your handler needs to pull out the code variable, and then send the following request:
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_CLIENT_ID&
redirect_uri=http://www.example.com/oauth_redirect&
client_secret=YOUR_SECRET_KEY&
code=YOUR_CODE
This request will return a string of the form access_token=YOUR_ACCESS_TOKEN.
Just parse off the 'access_token=', and you will have a token that you can use to access the facebook graph API, in requests like
http://graph.facebook.com/me/friends?access_token=YOUR_ACCESS_TOKEN
This will return a JSON object containing all of your friends
Hope this saves someone else some not fun time straining through documentation. Thanks for the help!
It is true, that Facebook's API is targeted at developers who are creating apps that will be used by many users.
Thankfully, the new Graph API is much simpler to use than its predecessor, and shouldn't be terribly difficult for you to work with without using or creating a lot of underlying infrastructure.
You will need to implement authorization, but this is not difficult, and as long as you prompt the user for the offline_access permission, it'll only need to be done once.
The documentation on Desktop Authentication would probably be most relevant to you at this point, though you might want to move to the javascript-based authentication once you've got a web app up and running.
Once the authentication is done, all you're doing is making GET requests to various urls and working with the resulting JSON.
Here's the documentation about Events, and you can get a list of friends from the friends connection of a User.
I'm not expert on Facebook/Facebook Connect, however I've seen it used/used applications with it and it seems there's really only the 'official' way to do it. I'm afraid it looks like your best bet would probably be something along the lines of this.
http://wiki.developers.facebook.com/index.php/Connect/Authentication_and_Authorization
Regardless of how you actually 'use' it, you'll still need to authorize the application to connect to the account and this means having a Facebook App as well.
The answer to Facebook application authentication is hard to find but is actually found within the "Analytics" page of the Graph API.
Specify the following: https://graph.facebook.com/oauth/access_token?client_cred&client_id=yourappid&client_secret=yourappsecret , you will then be given an access_token that you may use on all other calls.
The Facebook provided APIs do NOT currently provide this level of functionality.
I just want to import my facebook status and photos to my personal django website but all the examples and documentation i can find are for developing facebook applications.
A simple rss feed would be enough but it doesnt seem to exist in facebook.
Do i really have to create a full facebook app to do this?
A simple facebook application isn't that hard ... excluding trying to decipher the soup on developers.facebook.com.
The "problem" is that you need to get an application key, application secret, and sometimes a session key in order to access the web services. Unless someone is sharing a service to do just that (I haven't looked, and you'd need to trust them) then the only way to fulfill the requirements are to create an application. However, the application key/application secret don't actually require that you write anything. They will show up in the Facebook Developer Application (the application that allows you to edit your applications...)
Now, all you need is a session key (however, a session key is not always required, see the Understanding Sessions link below) -- and hopefully a permanent one. To do this, ask for the extended offline_access permission**. If you grant that to an application then it can get a session for you whenever it feels like it (or rather, the session does not follow the one-hour expiration policies for that application). Extended permissions. Understanding Sessions. Oh, but ignore that 'auth.renewOfflineSession(UID)' example -- the method doesn't exist. I told you the "developer" documentation was soup :-)
You can use the URL in format:
http://www.facebook.com/tos.php?api_key=YOURAPIKEY&req_perms=offline_access to request the permission of yourself. Now see the links below :-)
Extra information in:
**I'm not entirely sure if new changes to the FB policy affect forever-sessions, but this link seems more than relevant to the task at hand:
http://blog.jylin.com/2009/10/01/loading-wall-posts-using-facebookstream_get/
Getting offline_access to work with Facebook
Facebook offline access step-by-step
(You need never post/share your facebook application -- you can keep it in sandbox mode forever.)
Probably. Anything that bypassed authentication would be a fairly large privacy issue.
With the release of the new graph api, this is pretty simple once you get your oauth token. Unfortunately you will need to create an app, but it can be a rather small one to get your oauth token so facebook can authorize your requests. You can use the python sdk here: http://github.com/facebook/python-sdk/
Once you have your token, you make a call to: https://graph.facebook.com/[your profile]/statuses?token=[your token]
And you will get json back.
If you first login to facebook and then go to the documentation page you can see the working example by clicking on the statuses link in the connections table.
http://developers.facebook.com/docs/reference/api/user