Switching Domains

January 20th, 2010

Baer Development will be moving to a new domain (or rather, subdomain) http://baerdev.flashstuf.com/. Be sure to update your bookmarks, daily navigations, and such.

I’ll also be back soon with some new posts as I’ve started getting back into some, you know, development.

Miscellaneous

Facebook to Offer Usernames, but Not Without a Catch for Pages

June 9th, 2009

The powers at Facebook today announced that users will be able to pick personalized usernames for their profiles this coming Saturday, June 13 at 12:01am EDT. This is great news for all that can get to the site early enough to grab the best names, as it is on a first-come first-served basis. Facebook Pages are also eligible for their own personal name.

But, in a classic attempt to prevent the worst from happening before it actually does, there are limitations on Pages’ names. Pages may register at the same time users can, but the pages must have been live before May 31, 2009 to be eligible. This will prevent the numerous squatting attempts that are bound to happen. However, Pages must also have at least 1,000 fans by this cut-off date to obtain a personalized name–some not-so-good news for the many small bands out there (mine included) that have yet to reach this threshold. The comments on Facebook’s Pages announcement show how this discontent carries throughout the population. I’m sure the “1,000,000 strong against a 1,000 fan minimum” groups will start to spring up, and I completely support notifying Facebook of this misguided prevention attempt before this Saturday arrives.

Social Networking, Websites

Blogging by Email – Posts Stuck in “Pending Review”

April 6th, 2009

wordpressI’ve had a few issues posting through email to my WordPress blog. After emailing a post and refreshing my home page so that the mail is received, the post goes to “Pending Review” as opposed to “Published.”

There are a few workarounds, but one seems to be the easiest. Simply create a user account for the email address you blog from. For example, I might send posts from my Blackberry. So to fix the “Pending Review” problem I can create a username who’s email is set to my Blackberry email. In my case, I simply changed my main account’s email to this address.

This works, and easily takes care of the problem if you only submit posts from one email address. If more users post entries it still isn’t a big deal because you’ll need a new user account for them anyways. So as long as they send posts from the email address they sign up with, they’ll be able to blog through their email as well.

Fixes ,

YouTube Error Message

March 26th, 2009

I like YouTube’s Internal Server Error message:

500 Internal Server Error

Sorry, something went wrong.

A team of highly trained monkeys has been dispatched to deal with this situation.

Also, please include the following information in your error report:

GIHqf9UcRM85stJEEKPhsptV4MXW47NgWgv_IAL2IECtpKAZ0DhjCRp…

Google must be pretty confident that this message won’t come up often. The information to include in an “error report” was 20 lines of what is shown above. At least they have a sense of humor.

Humor

Facebook replacing Myspace?

March 5th, 2009

If you use Facebook, chances are that you were recently tagged in a “25 things about me” or (more recently) a “funny tag photo.” These fads have been sweeping Facebook for a few months now, spreading virally through friends tagging friends tagging friends, and then quickly dying off due to everyone getting tired of them. To show this, one of the 25 random things about the Facebook fad:

In the week between Jan. 26 and Feb. 2, almost 5 million “25 Things” notes were created, more than double the number of notes created in any previous week in the history of the site.

It’s interesting that Facebook is falling prey to the same kind of fads and memes that any social site falls to, with its users capitalizing on the technologies it has. For Myspace, it had bulletins that were posted out to all friends; so surveys and chain letters spread wildly. Facebook’s viral meme-spreading tool is tagging. So similar surveys and “tag your friend” pictures have spread because not only do these things show up to the user tagged, but all of his or her friends get to see what the person was tagged in. This also comes with an inherent mystery that entices others to click and see what his or her friend was tagged in.

Another thing is happening that has always accompanied Myspace in the past: websites about it. This happens all the time, but new sites are coming up that feature content for Facebook (not unlike the hundreds of “Myspace Codes” sites of yesteryear). Now, these sites are evolving along with the technology. Facebook brought a new, clean design to the social networking scene– one thing that Myspace never possessed (and was known for not possessing). Sites such as reface.me feature a design very similar to that of Facebook (making it cleaner), but also utilizes the technology of the time: Twitter, Facebook itself, RSS and more. Granted it’s a blog, the point here is that people aren’t simply throwing up badly designed websites loaded with Google Adsense ads and some codes just to make money on the hottest trends anymore. There is effort put into sites that even just support the mega-giants because the giants set the standard and (in some cases) raise the bar. In my opinion, Myspace has advanced very little in terms of actual innovation and even improving their design. Whereas Facebook, even though people may hate them at first for the changes they make, is bold enough to move forward with new ideas and ways to make things work– and that is what keeps people coming back for more.

No matter what, companies and individuals will continue to innovate; and as new start-ups arise and existing ones improve their services, the internet will continue to evolve. Facebook and Myspace are simply examples of some of the most popular sites setting this in motion externally, and keeping it moving internally. And whoever has innovated the most and given the people more than they could even hope for will probably come out as the winner in due time.

Social Networking, Trends , , ,

Creating the Facebook Publisher Interface

February 18th, 2009

After a successful implementation of my FlashStuf Facebook app, I went ahead and decifered the API to create an interface for the Publisher feature. I’ll cover the basic ideas here that will be pretty much universal across languages, but when I give code examples they’ll be in PHP.

First, the FlashStuf Publisher performs like this: a user wants to post a file from FlashStuf to his/her own profile or a friend’s. When they click “Share File” above the publisher, they are presented with a search box, a comment box, and the Post button which is only enabled upon selecting a file. Typing in a keyword will do a search, return the results to the publisher, and allow the user to select one. When posted, a feed story is published (as with all publisher actions). This is the kind of application I’ll be walking through (and you can see it in action here).

The Publisher interface is a little different from the Canvas page because it requires a JSON response, as opposed to plain HTML/FBML. On the FlashStuf Publisher, I simply compiled the markup into a single variable, $fbml, then used the following code to present the array of required data as JSON (get more information on the attributes on the New Design Publisher page of the Development Wiki):


$params = array('content' => array('fbml' => $fbml,
'publishEnabled' => false,
'commentEnabled' => true ),
'method' => 'publisher_getInterface'
);
echo json_encode($params);

Now that we have the interface, we need the user to be able to perform certain actions. This is a little more complicated than simply submitting a form or linking to a page in the site, as that exits the entire page– and we need information to instead fill the Publisher window. You can use AJAX here, as Facebook supports it, but I would highly recommend Mock AJAX, as it was the much faster and easier method to go about creating the publisher for me. This is what my search form looked like, including the form element to fill with search results.

fbapp_search


<form id="search_form">Search for file: <input type="text" name="search" /></form>
<a clickrewriteurl="http://www.myapp.com/publisher_search.php" clickrewriteform="search_form" clickrewriteid="results_content" clicktoshow="spinner">Search</a>
<form id="results_content"><img src="http://www.myapp.com/img/working.gif" id="spinner" style="display:none;"/></form>

Note that the clickrewriteurl is the page that the parameters are sent to, the clickrewriteform is the form from which parameters are sent, and clickrewriteid is the element id which will be populated with the results. More information can be found on the Mock AJAX page. Also, it is important to note that the clickrewriteurl will send back plain HTML– just like regular AJAX. This is the result:

fbapp_results

To enable the Post button once a selection was made, I used the FBJS setPublishStatus() method. Passing in true will enable the final stage: posting.


<input type="radio" name="file_id" value="125" onclick="Facebook.setPublishStatus(true);" />

Hopefully this is a good starting point. Next time, I’ll go into feed stories and how to post them using the Publisher.

Facebook Apps, Tutorials , , ,

Facebook App Development – Frustrations

February 11th, 2009

My current project, a Facebook App for FlashStuf, has been my first venture into the Facebook platform and API. While I managed to create and integrate the program with my site fairly easily over probably a week (total), there have been quite a few frustrations along the way.

I think the API is great and allows plenty of interaction with the platform. However, the documentation isn’t always up-to-date, and help on the forums is fairly hard to come by. This has really lead to a lot more development time spent on learning the API, rather than simply picking it up and jumping right into development. When I go to Google (my primary source of learning a language, API, anything), the results on the topic or example I’m really looking for are extremely sparse. The first two results are usually from the Developer Wiki and Developer Forums, and the rest are arbitrary sites and pages. So, as you can see, there isn’t much help out there to make this process a bit easier.

flashstufappssThe first obstacle of the implementation phase was the canvas page of my application. When I was first designing it, I wanted it to look similar to Facebook’s native interface, and I wanted some basic functionality present. First, the styles aren’t provided to your application by default. Instead you should look at all the pages about Facebook styles and insert them in your own stylesheet. However, this isn’t the solution to all your problems, because your stylesheets are cached; so any updates made to a central stylesheet will also have to involve a change to an appended “version” number on your stylesheet tag (e.g. “http://example.com/core.css?version=2″). These are just a few issues that took up a lot of development time.

The reason I really bring this up is because there is such a lack of example code and more in-depth details on the internet about developing Facebook applications (the newer features in particular). So when I want to add a new feature to my application, such as the publisher functionality, it makes it much more difficult and again, costs much more time to figure it all out when not only is the documentation vague, but there is little help elsewhere, save trial-and-error on your own. I’m sure this is because the platform is new and still mostly reserved for the few Facebook app elitists. But really, you would think that there would be more support and community on a platform that is so expansive–especially on the very basic things like how some feature works and how to implement some basic functionality having to do with it.

So I’m going to be posting my attempts and lessons learned with this new platform here (as I’ve done now), to hopefully alleviate this problem for others and possibly save someone else some time and headache.

Development, Facebook Apps , , ,

Using htaccess for Moved WordPress Blogs

January 31st, 2009

As you know, the Late Night Fiction name just recently moved to a new blog, which used to exist as Chicken Cheese on chicken-cheese.com. That blog moved to an all-together new domain and, as such, all the old permalinks and trackbacks now point to the wrong location. However, with a few changes to the chicken-cheese.com htaccess file (where the blog used to exist) and a little help from ModRewrite, all links will work once again.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule 2007/(.*) http://www.latenightfiction.com/2007/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule 2008/(.*) http://www.latenightfiction.com/2008/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule 2009/(.*) http://www.latenightfiction.com/2009/$1 [L,R=301]

I’ll break the lines down. However, you can skip this section if you already know how ModRewrite works.

  • RewriteEngine On turns the Rewrite engine on, as you might imagine. This is usually needed, as it isn’t always on by default.
  • RewriteCond %{REQUEST_FILENAME} !-f is a conditional statement saying that if the requested filename isn’t already a file on the server, use the following rule. However if it is, ignore the following rule.
  • RewriteRule 2007/(.*) http://www.latenightfiction.com/2007/$1 [L,R=301] does a few things. It provides a regular expression string to match the requested URL. In this case, it is 2007/(.*). This way, when someone goes to http://www.chicken-cheese.com/2007/09/12/... it’ll match and recognize the 2007/ part, and put anything that follows (.*) in the $1 variable. Following this line is a space, and where the browser should redirect the user. In this case, it is http://www.latenightfiction.com/2007/$1. Next are the command flags L and R=301. L indicates that the modrewrite should stop running through the file if matched and follow this rule. R=301 indicates that the browser should redirect with a 301 status code (permanent redirect). This is the right HTTP code to use because it indicates to browsers and search engines that the specified page has moved permanently and search engines in particular can update their indexes.

The rules are set up this way because I don’t have any folders on that site now that are named “2007″. This way the browser won’t redirect to a new site when I don’t want it to. Also, since I’ve only had three years worth of posts, duplicating this for each will cover any and all posts that were ever hosted on that domain (future ones won’t need to be added). I was also demonstrating using the most simplest of regular expressions– this could easily be accomplished in one rule (instead of three).

This was just one example of how ModRewrite can be used for moved websites. Using the same basic principles, you could easily create htaccess files for entire moved sites or directories that aren’t part of a WordPress blog.

Development , ,

Change Your “From” Address in Gmail

January 28th, 2009

gmailIf you’re like me and have multiple email addresses forwarding to your Gmail account, there is a way to also send mail “from” these accounts through the settings in Gmail. This has been very handy for me because email from most of my domains all forward to one account, and choosing which one I want to send from allows me to specify and keep them all separate.

To add email addresses, simply go to Settings in the top right corner, click the Accounts tab and look to where it says “Send mail as:” (the first block on that page). Click the “Add another email address” link to bring up a window that prompts you for your other email address, and the name to specify with it.

They’ll send you a email (you must own the address that you want to send from) that allows you to activate that email address on Gmail and send from it. Verify it, and you’re done!

Internet, Tutorials

Late Night Fiction becomes Baer Development

January 26th, 2009

We’ve gone and changed our name. Welcome to Baer Development, a name perhaps more fitting for this blog. We are, of course, still located at blog.chicken-cheese.com. However the name Late Night Fiction has gone to its very own domain over at latenightfiction.com, as previously promised (the site isn’t available yet, at the time of this writing). It is now the name of the blog holding the posts that previously existed here, before the split.

If this is at all confusing, just know that the name here has changed; and when you see the name Late Night Fiction again, it’ll be on my other blog. And, as for our Twitter pals, you won’t miss a beat. The URL has changed but you will still get updates, including this one so you’re not so confused.

Websites