Friday, January 7, 2011

Facebook code for creating test users

Here is the working code for creating facebook test users:

<?php
  // modified version of the code from
  // http://coding.pressbin.com/66/PHP-Create-test-user-accounts-in-Facebook/
 // See link above for deleting test users as well.  Take care to not delete your real account.

  //replace "#######" with your facebook app_id and secret key
define('FACEBOOK_APP_ID', ''######");
define('FACEBOOK_SECRET', '#######');

require 'facebook-php-sdk/src/facebook.php';

// Authenticate as an application to get an access token.
$url = 'https://graph.facebook.com/oauth/access_token';
$params=array(
              "grant_type" => "client_credentials",
              "client_id" => FACEBOOK_APP_ID,
              "client_secret" => FACEBOOK_SECRET);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params, null, '&') );
$data = curl_exec($ch);
curl_close($ch);

$access_token = str_replace('access_token=', '', $data);

print_r($access_token);
echo '<b>';

// Create the test user account
// replace ##### with your app ID.
$url = "https://graph.facebook.com/#####/accounts/test-users?installed=true&permissions=read_stream&access_token=$access_token";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params, null, '&') );
$data = curl_exec($ch);
curl_close($ch);

$request = json_decode($data,true);

foreach ($request as $key => $value) {
  if ($key == "id")
  echo '<br>Test user ID: '.$request[$key].'<br>';
  elseif ($key == "login_url")
  echo 'Log in as this test user: '.$request[$key].'<br>';
}
?>

I make no guarantees about this code but it works as of Jan 7, 2011.

Tuesday, November 23, 2010

No stupid questions

I hear there are no stupid questions but when you're expected to know this, it's really scary to ask.  What may seem like duh is usually something everyone is waiting for.  How the heck do you make facebook Graph API calls anyway?

So here's where I am.  Social networking and mobile apps is where it's at.  It's all a bit overwhelming when you're going about it alone and at the same time somewhat reassuring to hear facebook was built by a bunch of hacks (ha!).

Paper prototyping is the way to go.  There are many wireframing software but drawing it up on a piece of paper is the fastest.  Think fail quickly and get it to it.  To hire or do it yourself?  Buying time may be worthwhile.  I've been fiddling with Firefox/Firebug as an HTML editor which is recommended by facebook developers.  If there's anything that seems worth learning for a non-programmer in web development is HTML and CSS.  Drupal is a little heavy.  New modules put a strain on performance.  The cleaner the HTML the better.  I still can't believe Netscape is dead.  I am going back and forth with Drupal, Joomla!, Firefox/Firebug and notepad.  It turns out there's no one approach, it's the best tool for the job.  For now, I'm playing with Drupal themes.

On my first post, I've been pushing Hostgator but Facebook partnered with Joylent and Amazon Web Services.  Eventually any facebook apps should be hosted by AWS.

Thursday, October 28, 2010

Getting started on building a website FAST

by Christie Ewen

Web hosts

I spent about a little over a week researching webhosts. There are lots of cheap webhosts. Basically, you get what you pay for. What you want is scalability, reliability, and support. In the end, I chose hostgator. I am very happy with this decision. They have live chat so I can ask pretty much anything with one click. For example, “What’s the difference between domain.com and www.domain.com?” They’ll answer anything.

Here is a breakdown of webhosts that were recommended I looked into:

Web Hosts

Cost per month

Starts at

PROs

CONs

Other

Hostgator

$4.95

Great reviews 5/5 stars review

Great live support

Very good uptimes

Average uptime

$9.94 off package price:

COUPONCODE994

LunarPages

$3.95

Highly recommended by a friend web programmer

4/5 stars review

Fatcow

$3.67 (limited time offer)

Great uptimes

limited features compared with other webhosts

1and1

$0 for 6 months, then $6.99

Recommended by users

Mixed reviews

Godaddy

$2.99

“One stop shop for domains, web host and everything in between”

Mixed reviews

Cloudaccess.net

Free trial for 30 days

$9.95

Supports the Joomla! open source community

Great way to start using a CMS right away

Limited live support

Only supports Joomla!

Justhost

$3.45 for a limited time

Great uptimes

Poor reviews

Based outside US


For more comprehensive reviews, just google “lunarpages review” and “hostgator review” and so on …

Some of the reviews are outdated so what was true a year ago might not be true today.

Content Management Systems

CMS can help you quickly build a website.

I decided to go with Drupal because we needed technical flexibility. There is a huge community support behind Drupal so you can build almost any kind of website with Drupal. There are modules for almost everything like search, facebook, twitter integration, and so on.

I like Joomla! because I was able to get it up and running very quickly on cloudaccess.net which offers a free demo site for 30 days. Learning it didn’t take very long with the videos available on cloudaccess.net. The problem I found is that the user interface was not intuitive. I recommend trying it to get a feel for what CMS can do. Another nice thing about cloudaccess.net is their support for the open source movement without which we would be reinventing the wheel a million fold.

For some projects, Word Press might be all you need.

Outsourcing

You can save a lot of time and money by hiring programmers from India, Indonesia, etc. Just be sure when you outsource, you don’t outsource your “secret sauce”. Your “secret sauce” is what sets you apart from any other website. You can review outsourcing companies on sites like elance.com.

www.elance.com

www.topcoder.com

www.xicom.biz

I’ve personally never hired anyone from www.xicom.biz but they got very good reviews on elance.com so they might be worth checking out.

If there are any recommendations, please post here.


Copyright. Christie Ewen. October 28, 2010 All Rights Reserved.