Managing Test Users in Facebook

Recently Facebook implemented a new and more secure way of creating test users for your applications using the new Graph API. This new resource creates test users per application, allowing the developers of these apps to login as these users and test out their app’s functionality without using their own accounts and throwing test information into their live activity feed, this makes it very easy and clean to test new applications.

Its possible to create up to 100 test users per app, creation allows you to choose whether the user already should have the application installed and which permissions you want them to have, using API calls like:

POST /app\_id/accounts/test-users?installed=true&permissions=read\_stream

You can also remove users, list all of your app’s test users and even create friend connections between them using the API. This really is a great resource, but using an API to get this information all the time is cumbersome and might take time away from your time to develop the application itself.

This is where the Test User Manager comes in.

Having ran into this exact issue when developing for Facebook, I wished i could have a “phpMyAdmin”-like application to handle these requests for me and just give me a simple interface to work with. That’s when the idea was born an i decided to use the idea and opportunity to simplify my life and also learn/research a few other libraries and such.

I decided to create a very simple app, without a large MVC framework, just a bunch of actions. I also took the opportunity to use a simple template engine to see how it behaves, so i chose Twig for this. Since i did not have the comfort of large MVC framework to handle my requests, i also decided to look at funkatron’s Inspekt library to handle input security. Since i did not want to go through some troubles I also imported a limited set of tools from Zend Framework to handle autoloading and smaller tasks. Also having not worked with front-end too much in a while I took hold of jQuery and a few plugins to see what they could do.

All in all i had a very simple but effective app. Right now (version 0.9) it does the basics, add, lists, deletes and creates relationships between Test Users. But it handles exactly the most boring and annoying tasks. Let me show you a bit:

Listing/Managing Users

The user list will show you all of your test users, their IDs, name and permissions. With the command icons you can see the access_token, login on Facebook as the user, delete him or add new friends. Since this is a API heavy process to get all information loading is done in parallel using ajax.

Creating a User

The for to add new users is straight forward, you can add permissions and decide if the app will be installed or not for the user.

Viewing and Creating relationships

Clicking on the “add friend” icon you can view a list of existing relationships and choose a new user to associate with this user.

All the source code for this application is on GitHub, feel free to open feature requests and bug reports and of course pull requests at will. I hope this app can help you as a Facebook developer and make everyday life easier.

Download version 0.9 here

comments powered by Disqus

Related Posts

Brasil: Um só país, mas muito PHP

Brasil: Um só país, mas muito PHP

  • October 13, 2008

Todos nós sabemos que o Brasil é um país de dimensões continentais, aprendemos isso cedo nas aulas de geografia. Por isso mesmo acredito que a famosa frase “Esta cidade não é grande o bastante para nós dois” é algo que não deve valer para nós brasileiros.

Read More
Estendendo o Smarty: TinyMCE

Estendendo o Smarty: TinyMCE

  • March 12, 2007

(Nota: sim estender não extender)

Uso, e recomendo, a utilização do Smarty em qualquer projeto PHP. Porque?

Bem tenho inúmeros motivos para fazer esta recomendação, mas neste post vou me limitar a apenas citar alguns, pois não é o objetivo.

  1. Separar PHP e HTML: código limpo, manutenção fácil
  2. Code e Layout em paralelo: agilidade no trabalho em equipe
  3. Funções de maquiagem: formatar data, wordwrap, funções que dizem respeito a visualização, ficam na visualização
  4. Funções customizadas: estender o Smarty é simples e útil

É neste ponto, o número 4 que vou focar este post, utilizando o tinyMCE como exemplo.

Read More
1º PHPDF Roadshow

1º PHPDF Roadshow

  • April 26, 2007

PHPDF-RoadshowSerá realizado no dia 19 de maio o 1º PHPDF Roadshow, primeiro grande evento de PHP do Centro-Oeste e a inauguração oficial do PHPDF, comunidade de desenvolvedores do Distrito Federal.

Read More