Showing posts with label facebook. Show all posts
Showing posts with label facebook. Show all posts

Saturday, October 29, 2011

99X Brouhaha Picture Gallery

Digits in Motion is very excited to be working with 99X on this year's 99X Brouhaha Fan-Driven Photo Gallery. Event attendees can share all their pictures from the night by adding them to http://99xbrouhahapix.com - with easy import integration from Facebook and Flickr, it only takes 3 clicks to share your pictures with others who attended. You can tag costumes, to make it easy to find yourself in others pictures or find costumes you liked.

99X Brouhaha Photo Gallery | Share and Search Pictures From 99X Brouhaha

Thursday, January 6, 2011

Resolving Facebook.Web assembly error in web.config

I've recently been doing a lot of work with the Facebook SDK Toolkit and found myself with an issue when I uploaded a parent site up to my GoDaddy account.

I have a domain with several folders that host other sites, configured as application roots, but when I uploaded my facebook integrated site to the parent domain, each of the folder sites began experiencing server errors despite being marked as an application root: Could not load file or assembly 'Facebook.Web' or one of its dependencies. The system cannot find the file specified.

I did some research and came up bare, but I was able to figure out the issue myself. I track the bug down to a line in my web.config file:
<httpHandlers>
<add verb="*"
path="facebookredirect.axd"
type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" />
</httpHandlers>

This line came from the samples provided with the toolkit, but it appears to be unnecessary for my site's needs, so I just took it out. Everything seems to be working fine now.

Wednesday, January 5, 2011

How to Block Facebook Event Invites from Certain Users

Are you getting spammed by club promoters, bands and other Facebook accounts? I often get several facebook event invitations a day, most of which I have no interest attending. I'd say 90% of those invites all come from about 10% of my friends on Facebook. In the past, I've gone as far as defriending someone to save my inbox from the constant bombardment of their requests, but I finally decided to dig through Facebook's settings to find a way to block any particular user from sending me an invitation to their facebook event.


It's actually pretty easy, you just have to know where to click...

Step 1. In the upper right hand corner of Facebook, click on Account, then click Privacy Settings.



Step 2. At the bottom of the Privacy Settings, click Block Lists.




Step 3. Scroll down to find Block event invites. Fill in the names of users you want to block from sending you Facebook event invitations.



Likewise, on this same page, you can block users from sending you app invites or block users altogether if you don't want them to find you on Facebook.

Wednesday, December 1, 2010

Handling Line Breaks with FQL in ASP.NET

Facebook's FQL query language lets you do some really cool things as far as pulling data from Facebook profiles, events, groups and more. I've been using it lately to create fun websites for various events I've been hosting, but I ran into a small issue while pulling the wall posts from a Facebook Group.

I was able to pull everything from the wall, but it all came as one long string with no html line breaks <br/>. Seems simple enough to fix, right? I ususally append a .Replace(vbCrLf, "<br/>") to my string and I'm golden, but that wasn't working this time.

I tried everything I could think of: vbCrLf, Environment.NewLine, \n, \r\n, \r, Chr(13), PHP_EOL, ControlChars.NewLine, ControlChars.CrLf - nothing seemed to be working until I finally tried out vbLf

The vbLf constant represents \n just as vbCr represents \r and vbCrLf represents \r\n. Facebook uses the \n notation to store line breaks.

So if I were to store my FQL (Facebook Query Language) query results in a string called myFqlResult, I could print it out to the screen in a decent viewing manner with the string:

lblMyExample.Text = myFqlResult.Replace(vbLf,"<br/>")

Facebook also throw in all sorts of xml structures as well, so I usually filter it all out with something like this:
lblMyExample.Text = myFqlResult.Replace("<message>", "<p>")_
.Replace("</message>", "</p>")_
.Replace("<stream_post>", "<div>")_
.Replace("</stream_post>", "</div>")_
.Replace(vbLf, "<br/>")_
.Replace("<fql_query_response xmlns=""http://api.facebook.com/1.0/"" _
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" list=""true""><br/>", "")_
.Replace("</fql_query_response><br/>", "")_
.Replace("<?xml version=""1.0"" encoding=""UTF-8""?><br/>", "")_
.Replace("<div><br/>", "<div>")

Wednesday, June 2, 2010

Vanity URLs with GoDaddy Hosting using URL Rewrite

GoDaddy is a very affordable web hosting provider and domain registrar. I often recommend them to most of my clients who don't already have hosting set up. Unfortunately, GoDaddy does not allow you to access the IIS panel directly which sometimes makes a simple task slightly more complex as you have to navigate through their hosting control center, or sometimes entirely unfeasible. However, for the most part, they provide you with everything you would need to host most websites for a nominal fee.

I've recently had the need to create a portal that used vanity urls for each user profile on the site. For instance, if Aaron, Bob and Carl all have profiles on the portal, their respective portals may be:
Aaron: digitalplaydoh.com/profile.aspx?id=2
Bob: digitalplaydoh.com/profile.aspx?id=5
Carl: digitalplaydoh.com/profile.aspx?id=31

The client would like users to be able to select a unique ID for their account that can be typed out after the domain that will take users straight to their profile, similar to what you would find on Facebook or MySpace. ie:
Aaron: digitalplaydoh.com/aaronsmith
Bob: digitalplaydoh.com/bigbob
Carl: digitalplaydoh.com/carl


Microsoft's URL Rewrite module comes preinstalled on GoDaddy accounts with IIS 7.0. Here's where things get a little unfortunate for the GoDaddy developer. While running IIS 7.0, you will be unable to use Front Page Extensions, which means if you're using Visual Studio, you'll need to now connect to the site with the FTP method. Not terrible, but definitely a little slower.

Once you're running IIS 7.0, we're ready to start using the Microsoft URL Rewrite module. Open your web.config file and go to the <system.webServer> and add the following:
<system.webServer>
<rewrite>
<rules>
<rule name="RewriteCheck" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}"
matchType="IsFile"
negate="true" />
<add input="{REQUEST_FILENAME}"
matchType="IsDirectory"
negate="true" />
</conditions>
<action type="Rewrite" url="Profile.aspx?key={R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>


This allows us to find any path that is not a file or directory, and redirect it to Profile.aspx?key=(path). This means I need to now make sure that Profile.aspx can support me passing a "key" request parameter in instead of an "id", which is just a little work in how we pull from the database, but we've otherwise now go the ability to go to http://digitalplaydoh.com/carl and get Carl's profile page.

Note that you also need to be ready for an incorrect "key". Should I accidently type http://digitalplaydoh.com/calr, you need to be able to catch this as a incorrect keyword and show a proper error page.