Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Monday, September 7, 2009

Facebook Chat's Bold and Underline Text and Prodding Facebook Chat on a mission

I never noticed this before, but by placing asterisks around a word in Facebook Chat will bold the word, and placing underscores around one will underline the word. My first instinct was to figure out how to type italic text. Well a few Google searches showed that other people were looking for it as well; so I decided to go "straight to the horse's mouth," so to speak.

Figured the first place to start the search was in the messages that relay chat and see if the HTML conversion takes place there. Now mind you I've already poked and prodded Facebook Chat's message relay server before. Its a MochiWeb server, which you can see in the HTTP headers for chat packets. For more background specifics on the setup that is Facebook chat, see Facebook's engineering blog.

Server: MochiWeb/1.0 (I'm not even supposed to be here today.)

Anyhow, by reading the HTTP packet flow, I can get the "raw" information that the webpage uses to talk to the server. These I believe are in JSON although don't quote me on that, suffice to say I can at least read enough of the raw information they contain to see the message I just received. And sure enough these contain the text just as they would have been typed, that is, asterisks instead of HTML bold tags and underscores instead of HTML underline tags.

So, then this tells me that the replacement of "Facebook Chat style markup" takes place in the user's web browser. Problem is, there's a bunch of JavaScript files attached to any Facebook page. Fortunately for me though with Firefox with the FireBug extension the process of analyzing a web page's code is fairly streamlined.

Going straight to the code generated for a chat window, I noticed that the "pic_padding" class is on each message's node (which happen to be paragraph elements). So I searched for this class in the JavaScript given that is was the best lead I had. Fortunately this lead turned out results.

if(pendingMsgID||errorMarkup){
var pendingElementID=pendingMsgID?' id="pending_'+this.id+'_'+pendingMsgID+'"':'';markup+=''+
299(errorMarkup?errorMarkup:'')+'
';}

And just a couple lines below that, ta-da!

_processStyledText:function(textProcessor,str){return textProcessor(str).replace(/\b_([^_\*]+)_\b/g,'<u>$1</u>').replace(/(\s|^)\*([^_\*]+)\*(?=$|\s)/g,'$1<b>$2</b>');}

Yep, regular expressions. Just what I was expecting. No sign of a regex that replaces something with <i>..</i>. That's right, there is no way to type in italics.

So Facebook, why no italics?

Saturday, February 28, 2009

Google's Little SSL Problem

I'm not a usual user of Google Chrome. But I must say that I find it slightly surprising that Google's warning for SSL misidentification popups when I attempt to use the Gmail domain as a shortcut to mail.google.com with the HTTPS protocol.

Chrome is quick to notice that Gmail's certificate is for mail.google.com instead of gmail.com.

Wednesday, February 25, 2009

Project AD2

Since the comeback of Al1enDesigns, my old code has been having a bit of a complication which I'm not entirely sure of the exact cause of, but I'm putting the blame to poor coding style.

At the current time I'm working on approaching my content management system all over again. This time, I'm approaching it from an object oriented angle. I've been referring to this little project of mine as AD2.

Progress has been slow at best thus far. I've been hacking away on the many problems that have been coming up lately and I seem to be slowly gaining experience with PHP's style of OOP (as prior to this I've only used OOP in C++ and Java).

AD2 OOP Tech Demo

Of course, right now at least, you can't see what's really going on, just that it works. Maybe I'll manage to get some screenshots or class hierarchy information put up for criticism.

Tuesday, December 23, 2008

Akuyume@AD is down...

My homepage for the last year, Akuyume@AD is down [Googe Cache]. Last I checked my host still owns the domain name however his server subscription has run out. I'm tempted to grab the domain name myself if my host doesn't decide to continue running the website.

Thursday, March 27, 2008

Photoshop Express

Adobe has released a free online version of Photoshop, Photoshop Express. I'm undertaking a "test drive" at the moment, and will update after I've formed some opinions on Adobe's new webware.

Sunday, May 20, 2007

JS Hack

Atlanta Blue Skye, an Internet radio station, is threatening a blogger from Romania who revealed an already well known JavaScript hack for defeating right-click blocking methods. The incompetent and confused lawyers at this Atlanta Blue Skye then proceeded to request that a news site take down the blogger's blog and not cover the issue.
[thejemreport.com]

.bank TLD

An idea has been going around about creating a top level domain with strict verification measures for the banking industry. [http://blog.foreignpolicy.com/node/4834]  And in my opinion, this makes perfect sense.  Whether or not the average Joe realizes the change shouldn’t matter, the change comes in how browsers and other Web applications could handle the knowledge of knowing a website is a verified banking institute.

hit counter