How to Add Music Player to your Facebook Page

If  you maintain a Facebook page for your band, Facebook provides an application called the Music Player that you can use to upload songs to your band’s page.

When you upload a new song it is automatically published into the news feed of all your fans. You don’t have to send out fan updates to publicize new songs. Publishing into your fan’s news feed is currently the best way to get the attention of Facebook users.

Here are the steps to add Music Player to your Facebook band page :

Login to Facebook. Make sure you are the page admin for the page you are editing.

Ads and Pages

Ads and Pages

Click on “Ads and Pages” on the left menu.

Update: If you don’t see the “Ads and Pages” link on the left menu simply go to this link to edit pages http://www.facebook.com/pages/manage.

Edit Pages

Edit Pages

Click on “Edit Page” link at the bottom of the page you want to edit.

More Applications

More Applications

Click on “Browse More”  which will take you to the application search page.

Search Music Player

Search Music Player

Type music player in the search box and hit enter. This should take you to the Search Results page.

Music Player application

Music Player application

You should be able to see the “Music Player by Facebook” application in the search results.

Click on it.

Add Music Player to Page

Add Music Player to Page

Click on Add to my page. This should pop-up a dialog.  Select the page.

Thats it.

You should now be able see the “Music Player” application on your page.

You can edit the “Music Player” application to upload and display albums on your fan page.

Tip: You can add the “Music Player” to any page in general, not just a Band page.

Stumble it!

Virtual Box – Access host [Mac OS X] physical ethernet port from guest OS [Windows 7].

If you are in a hurry here is the quick summary :

To access the host machine’s ethernet adapter/port from your guest os, you need to create a bridged adapter on the virtual machine. The bridged adapter maps a virtual interface on the guest os to the physical ethernet adapter/port on the host machine.

Got some time ? Then read on…

I got  a new TRENDnet  Gaming Adapter TEW-647GA (Wireless Bridge) to connect my 20 GB PS3 to the Internet and also to explore the Internet@TV features of my Samsung LED TV.

TRENDnet TEW-647GA

TRENDnet TEW-647GA

The wireless bridge comes with a setup utility on a CD. If you are on a Windows machine then setup is a breeze. But if you are on a Macbook/Macbook Pro/Mac you may not be so lucky. Fortunately, for me I had  Virtual Box with Windows 7 set up as a guest instance.

How to Access the host ethernet port from the guest OS ?

Connect the wireless bridge to the built-in ethernet port on the host and power up it up.

From your guest OS, mount the host CD drive  and run the setup.exe utility.

By default virtual box sets up the guest os to use NAT networking, running the setup utility with the default (NAT) virtual machine networking configuration will fail. The wireless bridge will not be recognized by the setup utility.

Reconfigure the guest virtual machine with a bridged adapter and map this new adapter to the physical built-in ethernet network adapter.

Run setup utility again from the guest os.

Setup.exe should now discover the wireless bridge connected to the ethernet port on the host machine.

Follow the instructions on the TRENDnet  installation guide. On my Window 7 guest OS I had to ignore the error messages that said configuration had failed. The configuration had in fact completed successfully and I was able to connect to my Netgear WGR614 router and the internet.

Disconnect the wireless bridge from the ethernet port and connect it to the gaming console. The gaming console should automatically pick up an IP via DHCP and your gaming console should be connected to the net.

Have fun!

Additional Notes :

You can configure an extra adapter (adapter 2) on your virtual machine if adapter 1 is configured with NAT networking already. TRENDnet Setup utility will still recognize the wireless bridge connected to the ethernet port.

Stumble it!

How to Post to a Facebook Fan Page on Behalf of the Page.

Quick Summary

Use the Facebook.showPermissionDialog FBJS api call to authorize the Page for which you are an admin. Set the enableProfileSelector to true and include the page id in the profileSelectorIds. Once  the app user has authorized and given the extended permissions, You can use the Stream.publish api call with the page id as the target id and publish on behalf of the page.

The Details – Posting to the Facebook Fan Page on behalf of the page.

Facebook allows you to create pages aka fan pages for your website, business, product, or almost just about anything. Page admins can customize their pages by adding facebook applications from the app directory to their pages. Using Facebook applications for fan pages allows you to integrate into the social connections of your fans better.

Applications with extended permissions can publish to a user’s wall, news feed stream or profile. In addition, applications can now publish to a Page wall.

Publishing to a Page as a user is fairly simple with Stream.publish facebook api, the Facebook developer api covers this well. You can prompt the user for  ’publish_stream’ extended permissions using the  fb:prompt-permission FBML tag, preferably during an initial set up workflow.

Once the user has authorized your app and given the extended permission, You just have to set the target id to the page id in your Stream.publish api call.  See the sample php api call below,

$facebook->api_client->stream_publish($message, $attachment,$action_links, $target_id);

Publishing on behalf of  a page is trickier.  Page admins have to authorize the app to publish on behalf of a page. You can do this by using

the Facebook.showPermissionDialog FBJS api call.

Facebook.showPermissionDialog('publish_stream, read_stream', ondone, showProfileSelector, [1234,2345]);

Just replace the profileSelectorIds ( [1234, 2345]) and include the page id in the FBJS call above. This should bring up a permission dialog and show

a “profile  selector” including the page for which you are an admin.

You should now be able to use the Stream.publish api call with the page id as the target id and publish on behalf of the page.

Stumble it!

TarTool – Windows tar gzip tgz extraction tool

TarTool is a tiny windows command line tool to extract tar gzip (tar.gz or tgz extension) files.

You can download TarTool , unzip and run TarTool.exe as a command line executable.

You can also download TarTool from this alternate download location if the link above is down or does not work for you.

The source code  for TarTool is now hosted on codeplex.

I wanted to play around with the Microsoft Shared Source CLI SSCLI. The download is only available as a tgz extension. Imagine that :-(

After searching the interwebs for tools that would extract tar gzip files , I was disappointed since there was no simple tool to extract tar gzip files on my windows machine.

There are a few tools out there like WinRAR etc., but I found them too bloated for my task.

So I wrote a little tool using SharpZipLib, the open source Zip, GZip, Tar and BZip2 library (great job guys, BTW).

SharpZipLib does most of the heavy lifting so the core of TarTool  is less than ten lines of C#. I can host the source code if there is enough interest.

The source is now hosted on codeplex.

Enjoy!

 Update (05/06/2009 17:00 CST) :

TarTool now has an addtional option to untar tar file formats.

TarTool -x sample.tar temp

will untar the sample.tar contents into the temp folder.

Stumble it!

UI Programming Models

I found this excellent post Toward a better UI programing model with pointers to various UI programming models.

Web designers are forced to think within the constraints of the web browser when it comes to user interaction design.

The post above discusses more general approaches to user interaction design and not just within the context of the web browser.

Since I am mostly involved in web UI interactions these days this post was very refreshing as it brought a new perspective to me.

While developing the UI for a web app recently I realized that the web design world is in the search-discovery cycle of  “patterns” that guide user interactions.  Patterns in user interactions has the dual benefit of helping both designers and users. Much like the “guidelines” on Windows ( Windows User Experience Interaction Guidelines ) or Mac (Apple Human Interface Guidelines ) development platforms that help Windows or Mac application developers respectively while standardizing the user interactions of the applications developed on those platforms. These guidelines ensure strict quality, improves user experience and makes the life of designers easier.

There are plenty of resources that discuss “web ui interaction patterns” .

Designing Interfaces is a good resource if you are designing web user interactions. Rob Adams one of the core developers of Adobe’s Flex  has an excellent set of introductory articles which not only apply to designing user interfaces using Adobe’s Flex but applies to user interface design in general. I especially liked the Structuring your Application part.

Everyone loves the web, even if there are a few frustrations that we still have to overcome :-)

Happy Surfing !

Stumble it!

Git Fast Forward

>git branch -a

* development

mylocal-branch

origin/development

>git status

# On branch development
nothing to commit (working directory clean)
>git merge mylocal-branch (you want to merge from mylocal-branch to development branch )

> git push <repository | origin> development

Works if the remote branch ‘development’ has no simultaneous commits from a co-worker, say.

But fails with the following messages if there were simultaneous commits on the remote branch ‘development’

! [rejected]        development -> development (non-fast forward)
error: failed to push some refs to ‘<your repository name>’

Here is how to fix this scenario,

> git pull <repository | origin> +development:development

The ‘+’ option fast forwards the local ‘development’ branch to the remote ‘development’ branch

> git merge mylocal-branch

At this point you have changes from the remote and local ‘development’ branches merged

> git push <repository | origin> development

The changes were now pushed to the repository without being rejected. This is one scenario where you can use fast forward to merge changes and bring local and remote branches upto date.

Stumble it!

newline characters in PHP error log or debug output

There is a PHP Predefined constant PHP_EOL that allows you to print a newline character if you are running php CLI or if you are outputting text to an error log file.

Apparently, it is also cross platform compatible.

For a long time I was using print statements to throw debug output and had a hard time reading the blob of text output that was getting spit out.

Now my log output and debug output are much more readable :-)

Stumble it!

Some useful and common regular expressions (regex)

Regex for URI

 var uri_re = /^(?:(?:[^:\/?#]+):)?(?:\/\/(?:[^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/;
Stumble it!

” Don’t miss this one! “

While waiting for my car to be fixed at the dealership, I was browsing through the day’s local newspaper.

This ad on the business section of the paper caught my eye,

“Great Minds Gathering on Oct 7 – Don’t miss it. Today’s date Oct 23 2008.”

Quite entertaining

Quite entertaining

With all the doom and gloom, market crashes and poor earnings reports, this is the only thing on the business page that brought a smile.

Stumble it!

MPLS ALT.NET – The first get together.

MPLS ALT .NET

MPLS ALT .NET

Yesterday was the first ever MPLS ALT.NET get together at the Bulldog N.E Thanks Ira Mitchell and Jim Swanson for hosting. Judging by the turnout at the initial meet one can easily tell that there is a great enthusiasm for alt .net in Minneapolis.

Jim and Ira do a better job of explaining What ALT .NET is all about.

The folks at Redmond, WA do a great job trying to build awesome tools for developers but often times committing resources to every available tool in the open source community is not possible. Filling this gap is where a community like ALT .NET can help.

The state of Microsoft and the OSS community is better explained by Ayende Rahien.

I hope that this community becomes successful and brings in the best of the OSS, Java and RoR communities into the .NET world.

Stumble it!