Facebook changed their PHP SDK a lot with version 4.0, so i thought you could use a tiny tutorial how to authorize users and how to use the API with the new version. Feel free to comment about any errors or suggestions.
Andreas Teufel
Extended Page Access Tokens with CURL
This is a follow up to my article about Access Tokens for Facebook. It is quite easy to generate an Extended Page Access Token with the PHP SDK, but being a big fan of the Facebook JavaScript SDK i try to avoid using the PHP SDK. So this is how you create an Extended Page Access Token with CURL only. Just in case you don´t know about those Tokens: They can be used to post to a Page (as the Page, not a User) or get the Page Insights – but the most important thing is that they don´t have an expiration date! You generate it once, store it in your database and use it forever.
Raspberry Pi for N00bs – Cron Jobs
I´ve explained the basics of Scripting with Python in my former article, but what if you want to run a script periodically on your Raspberry Pi? Well, there is this crazy little thing called “Cron Job”. It is quite easy to set them up on your Raspberry, this is how.
Raspberry Pi for N00bs – Scripting with Python
Although I prefer other languages, here´s a small tutorial to get you started with Python on your Raspberry Pi. The latest Rasbpian distribution already comes with Python so you don´t even need to install anything else. Actually, i even found 2 versions on my Raspberry, 2.7.3 when i just run “python” in the terminal and 3.2.3 with “python3”. Obviously, we will use python3 here.
Raspberry Pi for N00bs – Network Share with Samba
Before getting serious with a headless Raspberry, it´s a good idea to set up a folder to be uses as network share in Windows. That is, if you are a Windows user. If you are a Linux user, i expect that you know how to reach your Raspberry. In that case, you would not even read my N00b posts, i guess 😉
Raspberry Pi for N00bs – WLAN
So you already know how to connect to the LAN, but sometimes the Router is not right next to the Raspberry Pi and you need a wireless connection. Not every WLAN stick is compatible, check the compatibility list before you buy one. I am using a TP-LINK 150Mbps Nano, no additional driver needed and you almost don´t see it when it´s in the Rasbperry. With “ifconfig“, you can see if the WLAN stick is up and running with the correct driver:
Raspberry Pi for N00bs – Firmware Update
Every now and then, it is a good idea to update the Firmware of your Raspberry Pi. There is a very nice tool out there to make that easy for you: https://github.com/Hexxeh/rpi-update
It is quite easy to install the tool, first you have to install GIT:
sudo apt-get install git-core
Raspberry Pi For N00bs – Linux Basics
After installing a Linux distribution as explained in my article “Raspberry Pi for n00bs – Installation“, it is time to change some basic settings. This article covers everything you need to know to get your system ready to use. I only run my Raspberries “headless”, without a monitor/TV. Saves an expensive gold-plated HDMI cable and all the cool kids do it 🙂
Raspberry Pi for N00bs – Installation
A complete PC for only 30 Euros, super-silent without active cooling, the operating system on SD card. That is the Raspberry Pi 🙂
Shopping List
…ok, to get it up and running, you will need a few more Euros, here´s the minimal configuration:
- Raspberry Pi – B/B+ (30-35 Euros)
- Ethernet cable (1-2 Euros)
- Power supply with at least 0,7A (better 1A) and Micro USB (5-10 Euros)
- One of the countless Raspberry cases (5-10 Euros)
- SD card with at least 4GB, better 8 or 16 (10-20 Euros)
Now we´re already at ~50 Euros, but the Mini-PC only needs 2-3 Watts and practically no space.
A HDMI cable and a USB keyboard are optional, for the first installation and if you don´t just want to administrate the Raspberry Pi with SSH. Check your local supplier for all the items, SD cards are pretty cheap at Amazon. It´s a good idea to check the compatibility list first: http://elinux.org/RPi_SD_cards
Facebook API – Access Tokens
There are 3 different Access Tokens, each one with a specific purpose while dealing with the Facebook API. The Facebook docs cover the basics to get you started, it´s all about the Web here, so i will not cover the fourth one in the list: the “Client Token”.