Facebook API and Drupal - drupal

I'm trying to use the drupal module called FB (http://drupal.org/project/fb). I just want to know if I'm on the right track. I've installed the module, setup the keys and so forth. All I want is the following:
To make a call into facebook
Retrieve all MY notes
Retrieve all the COMMENTS on my notes
So my questions are:
Is it necessary to write an app if I just want to make simple call like this?
Is there an easier way than the module i'm using?

You may find that the Activity Stream facebook extention does what you need.

Making some assumptions here: 1) you're familiar with programming drupal modules, 2) not so much with the facebook api, 3) you want to export your notes to display on a personal site.
The short answer is Yes, you need to create an application. You need the facebook client API files, and an API key/secret, which you only get by creating an app. Sounds like you've already gotten this far anyway.
However, from first glance, it looks like you only need to enable the DFF facebook API module, and then you can write your own module, using the global $fb to access facebook. The client API methods are mostly self-explanatory, if a little tweaky.
Possible problem: if your facebook details are restricted to friends only, visitors to your personal site won't have access to your notes via facebook API calls. The API only exposes what's publically accessible, or it exposes the (user-specific) details & friends when a visitor logs in (prompted by calling the require_login method). So, I imagine you'd need to store the notes locally, updating them by logging in yourself.
You could feasibly bypass the DFF modules altogether & just include the FB client API from your own module, but DFF looks like it handles all the weird & badly-documented fb behaviour - particularly that related to require_login - that'd otherwise have you smacking your head against a wall for three days. Good luck.
Caveat: I've never used the DFF modules. I used FBConnect, which was sufficient, but I spent a lot of time smacking my head against a wall.

Related

Is there a way to get a developer account to avoid being confused with an automated tool?

I'm currently developing a Chrome extension to use with LinkedIn Sales, and I'm having issues while testing the front end.
Due to some style changes, I had to refresh the page multiple times and now my account is temporarily banned because they confused me with an automated tool.
Does anyone know a workaround for this? Or, alternatively, can I create some type of developer account to use?
TIA!
Due to some style changes, I had to refresh the page multiple times
This is really a suspicious action.
So isn't your "Chrome extension" also an automated tool?
Either get some API access (you find available APIs here https://developer.linkedin.com/product-catalog)
or if you just do some visual brush-up for users, you could try to make an offline copy of the page once (with a tool like HTTrack) and then use that copy for development.
For the Sales API it says
It's required that all integrations are built by approved partners for the SNAP program. To become a partner, visit this page.

Download/Upload of Page Remarkup in Phabricator Wiki (Phriction)

The company I work for uses the "Phriction" wiki in Phabricator for a considerable amount of documentation. I'd like to be able do the following, programmatically, in order of importance:
Download (e.g., with curl or wget) the ReStructuredTExt (RST) to a local file where I can edit it, diff it, etc. Ideally I should be able to download either the latest version or any specific version.
Locally render (e.g., in a local graphical web browser) the markup as Phabricator would render it. If relative links can link correctly back to the original wiki, that's a bonus.
Upload new versions of the wiki page.
If you have don't know how to do exactly any of this, but have information or tool suggestions that would help me get started on writing software to do the above, please mention them. (If you're worried about too many answers that don't actually answer any of the questions above, try adding or editing a single community answer for this sort of information.)
I would do the following in your situation:
Downloading the single phriction pages using the API (Conduit) methods in the phriction section.
Therefore you need a Conduit Api Token. You can create in your profile settings of your phabricators intstance.
Then take a look at the phriction.info mehtod: This methods needs the page slug as parameter. In this example I use the /changelog/ page.
You can choose between arcanist, cURl or PHP to use the RestApi. Additionally you can use any other way to preform RestApi commands in the cURL syntax.
If you need some more examples how to run the conduit method you can toggle between some variations at the bottom of the output page.
Transform the page content as you like.
Upload the page again with the conduit methods (phriction.edit).
The way you downloaded the content you can edit the documents, too. But here you need some more parameter:
I personally, try first all conduit methods via the web interface first and then transform it to an a script.

How to build a simple HTML Form that sends email on Firebase?

I'm new to Firebase. I just want to build a simple HTML form on Firebase that sends email to me as well as to the user who fills up the form upon submit button click. I do not need any user authentication or database. After that I want this HTML form to be able to embed on my Blogger website, probably using iFrame. So how can I go about doing this?
Based on my understanding, for a HTML form to send email requires server-side coding like ASP.NET and PHP, may I know which language should I use on Firebase? Does Firebase provide such SDK that I can simply write in JavaScript and create a .js file for my form handler?
I already know how to deploy HTML files to my Firebase project using Node.js and get the URL of every file that I deployed, e.g. images, css files etc. Any help would be greatly appreciated, thank you.
With Third Parties (by now)...
After many hours researching about this, the solution seems not to be inside Google at the moment, but using a third party: SendGrid.
Tyson Bailey created a small example and explains this methodology in this blog post.

Meteor.js - Template Permissions

This has been asked in similar forms here and here but it seems pretty important, and the framework is under rapid development, so I'm going to raise it again:
Assuming your login page needs to face the public internet, how do you prevent Meteor from sending all of the authenticated user templates to a non-authenticated client?
Example use case: You have some really unique analytics / performance indicators that you want to keep secret. You've built templates to visualize each one. Simply by visiting the login page, Meteor will send any rando the templates which, even unpopulated, disclose a ton of proprietary information.
I've seen two suggestions:
Break admin into a separate app. This doesn't address the issue assuming admin login faces the public internet, unless I'm missing something.
Put the templates in the public folder or equivalent and load them dynamically. This doesn't help either, since the file names will be visible from other templates which will be sent to the client.
The only thing I can think of is to store the template strings in the server folder and have the client call a Meteor.method after login to retrieve and render them. And if you want them to behave like normal client templates, you'd have to muck around with the internal API (e.g., Meteor._def_template).
Is there any more elegant way to do this?
I asked a similar question here:
Segmented Meteor App(s) - loading only half the client or two apps sharing a database
Seems to be a common concern, and I certainly think it's something that should be addressed sometime.
Until then, I'm planning on making a smaller "public" app and sharing the DB with an admin app (possibly in Meteor, possibly in something else, depending on size/data for my admin)
These 2 packages try to address this issue:
https://atmospherejs.com/numtel/publicsources
https://atmospherejs.com/numtel/privatesources
It uses an iron-router plug-in to load your specific files on every route.
The main drawback I see here is that you must change your app structure, as the protected files need to be stored in /public or /private folder.
Also you are supposed to use iron-router.

ASP.NET Browser Debug (support information) page

So one of the many many tasks I'm faced with daily as a developer is trying to get our support department to get as much information about the end users environment as possible.
Browser version, current cookies, plugins, etc etc and it would be handy to point people to a specific page on our site and say "copy paste this to support".
In the past I've always written these by hand, and used third party tools (such as BrowserHawk) to get as much info as possible.
How does everyone else deal with getting this information from end users, is there a nice package I'm unaware of to give a detailed dump a users env without having to get the users to run an app?
Just to clarify I'm not looking at an elmah style reporting (which is very helpful as well!) but this mainly for the client side stuff.
Some months ago I have see the googles ads page have a cool nice report button. What this button do is that capture using javacript the page as it is and send you the report, with all the details, and an image of the actually page.
So I have found this library http://html2canvas.hertzen.com/ that make the same think.
And here are some example pages with this feedback.
http://hertzen.com/experiments/jsfeedback/
So I add this feedback option, and I ask from the users to point out the issue, and send the feedback, so for pages I have a very nice image for what is not going well.
The next think is that I log and check all errors, and I fix them soon.

Resources