Google Wave: Waves, Wavelets, Blips…What is all of this?

The next big wave from Google is the Google Wave. In the recent Google I/O event, Google showed a demo of its latest upcoming project, the Google Wave. From the looks of it, Google Wave is the convergence of Email, Instant Messaging, Collaboration and Social Networking.

google-wave-iWhen Google launched Gmail, the traditional email way of ‘Reply’, ‘Reply to All’ concepts changed dramatically as Gmail introduced the new concept of conversations. Gmail automatically grouped related emails in a single conversation for ease of management of emails. With Google Wave, you just start a new wave, instead of creating an email. You then drag and drop your contacts to this new wave which is immediately visible to the selected contacts real time. Now moving ahead from the conversation concept, the wave obviously takes the inverted tree structure. Therefore, any single conversation within this wave can branch out in its own. For example the wave lets the participants to add, modify content real time under any nodes which is immediately available for the rest to view and edit.

Now if it is quite confusing, think of the combination of Email and Instant Messaging into a single interface. That is the wave. Participants can reply, chat, in real time. In traditional IM clients including Google Talk, half the time is spent on waiting for the other party to type something. While he/she is typing, you only see ’so and so is typing’ until the user hits the submit button. In Google Wave, since it is real-time, as you start typing, the other participant can view as you type, letter by letter (that’s true). This makes the conversation quite fast and saves tremendous amount of time compared to normal IM clients.

In addition to Email and IM, Google Wave now combines collaboration in to the same interface. So teams can easily create a wave, edit it simultaneously, embed images, links etc into this wave and makes real-time collaboration between teams fast and easy. This is especially true for enterprises where some still practice the common shared folder with multiple sub folders and multiple versions which makes organizing the documents a nightmare. Even with SharePoint you need to check in and check out which makes real-time multiple edits impossible. With Google Wave real time multiple edits works great.

google-wave-iiGoogle Wave APIs makes it easy for developers to create Google wave extensions. There is no limit to how these extensions can be used. At least in the demo, a few great extensions were shown. One very interesting and useful feature was the automatic language translator. So if you happen to have a Chinese girl friend and you no nuts about Chinese language then you could use the Google Wave to type in English while your Chinese girlfriend will see real time Chinese translation of what you have typed. She then can reply in Chinese which is automatically translated on the fly and you see the English version of the text as she types in Chinese word by word.

A few more promising features in the demo included, integration to blogs, twitter and other external sites. Where you can embed and converse between a Wave and a blog or a twitter which is quite cool as when someone replies to a blog comment, it is automatically embedded in the Wave real time. Another rich feature is the images integration into Waves. You could just drag and drop images to your waves, share them, comment on them etc with relative ease.

The best part of all this is of course Google’s trademark search facility in Google Wave. You can search anything and everything in your Google Waves which makes the whole experience richer.

Google Wave Terminology

A wave is a threaded conversation, consisting of one or more participants. The wave is a dynamic entity which contains state and stores historical information. A wave is a living thing, with participants communicating and modifying the wave in real time. A wave serves as a container for one or more wavelets defined below.

A wavelet is a threaded conversation that is spawned from a wave (including the initial conversation). Wavelets serve as the container for one or more messages, known as blips. The wavelet is the basic unit of access control for data in the wave. All participants on a wavelet have full read/write access to all of the content within the wavelet. As well, all events that occur within the Google Wave APIs operate on wavelet level or lower.

When you spawn a wavelet from within a wave, you do not inherit any access permissions from the parent wavelet. During the lifetime of a wave, you may spawn private conversations, which become separate wavelets, but are bundled together within the same “wave.” Since events occur at the wavelet level or below, the context of an event is restricted to a single wavelet. A wavelet may be created and managed with a robot as its only participant. This allows the robot to use the wavelet effectively as a private data document. These data documents are never rendered/revealed to the user and may contain structured or unstructured data about the wavelet.

A blip is the basic unit of conversation and consists of a single messages which appears on a wavelet. Blips may either be drafts or published. Blips manage their content through their document, defined below. Blips may also contain other blips as children, forming a blip hierarchy. Each wavelet always consists of at least one root blip.

google-wave-blips-etc

A document is the content attached to a blip. This document consists of XML which can be retrieved, modified or added by the API. Generally, you manage the document through convenience methods rather than through direct manipulation of the XML data structure.

Posted by pmfiorini on Jun 11 2009 in Google Wave

Topsy.com: A Cool Search Engine For Twitter

topsy-iiTopsy.com Providing a Better Twitter Search

Topsy, new Twitter search site, was launched in May 2009. Rankings for social media data is purely based on the number of times the link has been tweeted, for whatever time window you select: hour, day, week, month, all-time. When grouping by URLs, they resolve compressed versions from bit.ly or tinyurl. The resolved link, along with the number of tweets, and the text of a recent tweet, are displayed. Along the right margin, you get a list of common users and the number of times they’ve contributed to the result set. You can also search within a particular user.

If you click on a tweet group, you’ll get a list of posts, and a list of “What’s Related”. The quality of the related tweet groups is a bit sketchy. Tweets are short, not much to go on. You could imagine just pulling out the most statistically overrepresented words from the a tweet group. For the baseline you’d want to calculate word frequency from a lot of tweets, not a corpus of standard written English. Tweets have their own language. Take the top few words, throw them into a full-text search engine, and group the results by their resolved URL. As I mentioned before in a post about real-time search, its not terribly complicated. The tricky part is getting a feed of tweets from Twitter. Once you have it, you pull every URL. For each one, do a HTTP HEAD request to get past bit.ly, tinyurl and the like. That will save you some time and bandwidth over downloading the entire page. Perhaps have a short list of URL-shortening services and use those to filter. Some of them, like bit.ly, also provide an API where you can expand the shortened version without doing the HEAD request.

You have the URLs, timestamps, usernames, and tweet text. Since you’re grouping by URL’s, you might also consider only indexing tweets that have links — that will reduce the size of your indicies. This is not rocket science. I was baffled by their $15MM purchase of Summize. I suppose in the case of Summize a premium was paid to get it quickly. According to CrunchBase, Topsy raised $15MM. Of that, $11MM was raised last December. I wonder why they need all that money? Right now they list 14 people on their web site, and their product feels like a $4MM product, what they have so far is not terribly complicated even when implemented for scale. Perhaps they have big plans for the future, or anticipate big hardware bills and low revenue in the short run.

So although I like Topsy very much, they are dependent on Twitter for their feed of tweets, and whatever current value you might give to their enterprise, most of that value is in their access to the complete tweet feed. Twitter controls that, and can shut it off, so they don’t seem like a good target for acquisition for anyone except Twitter. I don’t see any patent applications on file at the USPTO. Or as with Summize, they might hope to fetch another premium for getting a search product out quickly. Twitter already did that once, I doubt they’ll do it again, they already have search expertise in-house now. Perhaps they want to get a big user base, and hope that Twitter won’t have the guts to shut them down — negotiating with someone who’s holding a gun to your head, and hoping they don’t want to bloody their shirt.

You don’t raise $11MM without a plan, even with all the crazy hype over real-time search. That money probably put the finishing touches on their current search offering, but will largely be going towards new products that would be better targets for acquisition. Their investors have experience with mobile technology, perhaps they have a clever way to move this onto mobile devices.

Posted by pmfiorini on Jun 10 2009 in Social Media Marketing

Celebrities Who Drive Green

toyota_prius_photoThe environment, gas prices, etc., are giving drivers more incentive than ever to consider the alternatives, it’s a good time to review all the celebrities who have already taken the plunge with the most famous alternative: the Toyota Prius Hybrid.

Celebrity Toyota Prius Drivers…

Among the first famous Prius drivers is early adopter Leonardo DiCaprio, who’s been driving one since 2001 when they were new. Then Cameron Diaz got one. Then, like, EVERYBODY got one. “Everybody” includes usual green and/or lefty celeb suspects like: Alicia Silverstone , Arianna Huffington, Brad Pitt, Julia Roberts, Bill Maher, Prince Charles, Woody Harrelson, Harrison Ford, Ed Begley, and Susan Sarandon.

But now the Prius is common enough that less-expected Prius owners in Hollywood number easily in the dozens (maybe more like hundreds), including Kevin Bacon, Jack Nicholson, Billy Crystal, Larry David , Ewan McGregor, Robin Williams, David Duchovny, Alexandra Paul, America Fererra, Billy Joel, Dr. Andrew Weil, Ted Danson, Will Ferrell, Salma Hayek, Patricia Arquette, David Hyde Pierce, Ellen DeGeneres, Tom Hanks, Rob Reiner, Hart Bochner, Donny Osmond, Kurt Russell, Jack Black, Donna Mills, and Kirk Douglas. The jury is still very much out on whether the Prius is the best (or even a good) green car option, but it is certainly the most recognized.

Celebrity Ford Fusion Drivers… adam-lambert-hybrid1 American Idol runner-up Adam Lambert loves his new hybrid. Lambert says, “Hybrid all the way. Let’s protect the environment.” He may not have won first place on American Idol, but runner-up Adam Lambert is happy anyway, especially since he was given a Ford Fusion Hybrid. Lambert and winner Kris Allen each received hybrid cars from the Ford Motor Company.

Backstage after last night’s American Idol finale, Lambert was all smiles, psyched about getting to sing with Queen and KISS. Asked if he was happy with his Ford Fusion, Lambert replied,

“The Fusion is beautiful. It’s so whisper quiet. Hybrid all the way. Let’s protect the environment.”

Hey, rolling through Los Angeles in a Ford Fusion hybrid is a pretty good consolation prize!

Posted by pmfiorini on Jun 10 2009 in General

The Death of Google??? – Topsy.com: A Real-Time Content (Social Media) Search Engine

A new search engine, Topsy, which has been in stealth development for three years, has recently launched and may eventually challenge Google for search engine supremacy.

A Brief History of Search Engines…

Before Google, search engines like determined relevance based on how well a web page matched the query. Then came Google, which views the web as a network of documents. Today, all search engines analyze linking behavior around the web.

When a web page is linked to a lot, it’s given more influence than other pages competing for attention around the same topics/keywords. Jeff Jarvis summed it all nicely in 2005 “In this new world, links are currency. Links grant authority. Links build branding. Links equal value.” There’s lots more to it, but the notion that links create value is what drives Internet search.

The Search Engine Landscape Today…

Well, it’s no longer 2005. Back then blogs were giving Google fits because of how fast and irregularly they updated. Google had to make decisions on how often to index pages. Indexing is expensive, so there’s a tradeoff. Ping servers and blog search engines rose briefly to fill the niche, but Google indexes most popular blogs so often that those blog search engines are no longer much better.

Now, though, we have so much real time content being created that Google and the other engines can’t keep up. Most of this content is on Twitter, but FriendFeed, Facebook, Digg and lots of other services are adding to it, too. The result – more and more people are doing searches in Twitter search in addition to Google. For me, someone who’s obsessed with news and stuff that’s happening right now, Twitter search is about 25% of my total Internet searches. The ratio keeps going up over time.

That’s where Topsy comes in. It’s not strictly speaking a real time search engine like Scoopler, which we wrote about earlier this month. Topsy is just a search engine. That has a fundamentally new way of finding good results: Twitter users.

The 30 million or so Twitter users are an army of little content-finding machines. Topsy says those users are sending tens of thousands of unique links per day to interesting things around the Internet.

Some of those users have more influence than others. And some links are sent by lots of Twitter users, others just sent once. Those links, combined with the information in the Twitter message itself, is what Topsy uses as the basis of its search engine.

And the results are…amazing – See for yourself at Topsy.com

New stuff in particular percolates up very quickly. A search for Facebook, for example, shows lots of news about the funding that was announced earlier today. And the links are sorted by those that Twitter users are sending around the most, weighted in favor of links sent by more influential Twitter users. You can sort results over all time (going back to September 2008), last month, week, day or hour. For all time, top results for Facebook are the Facebook site and developer site, among others. But in the last hour and day, it’s all about the funding news.

Results show popular links but also the most influential users tweeting about that topic. Click on that user and you’ll see all their tweets about the topic. Here’s the results for TechCrunch and Facebook, for example.

User influence is a hot topic, of course. Topsy isn’t looking at the number of followers. Rather, Influence is gained when others retweet links you’ve sent out. And when you retweet others, you lose a little Influence. So the more people retweet you, the more Influence you gain. So, yes, retweets may be part of the new currency on the web. Told you.

Topsy was founded in 2006 and has raised nearly $15 million to date in venture and debt funding. More information on the funding and founders is on the CrunchBase page for today.

topsy

Here’s a video where the Topsy founders give an introduction to the service and how it works:

Posted by pmfiorini on Jun 9 2009 in Social Media Marketing, Twitter

Watch Out Google…It’s Time To Start Thinking Of Twitter As A Search Engine

twitter-logoTalking to a friend today, the conversation quickly turned to Twitter. He just didn’t get it, and he’s certainly not the first person to tell me that. Specifically, my friend didn’t understand the massive valuation ($250 million or more) that Twitter won in its recent funding. I told him why I thought it was more than justified: Twitter is, more than anything, a search engine.

I told him what I thought of Twitter as a micro-blogging service: it’s a collection of emotional grunts. But it’s wonderful nonetheless. And enough people are hooked on it that Twitter has reached critical mass. If something big is going on in the world, you can get information about it from Twitter.

Twitter also gathers other information, like people’s experiences with products and services as they interact with them. A couple of weeks ago, for example, I was stuck in an airport (Philadelphia) and received extremely poor service from US Air. I twittered my displeasure, which made me feel better – at least I was doing something besides wait in an endless line.

More and more people are starting to use Twitter to talk about brands in real time as they interact with them. And those brands want to know all about it, whether to respond individually, or simply gather the information to see what they’re doing right and what they’re doing wrong.

And all of it is discoverable at search.twitter.com, the search engine that Twitter acquired last summer.

People searching for news. Brands searching for feedback. That’s valuable stuff.

Twitter knows it, too. They’re going to build their business model on it. Forget small time payments from users for pro accounts and other features, all they have to do is keep growing the base and gather more and more of those emotional grunts. In aggregate it’s extremely valuable. And as Google has shown, search is vastly monetizable – somewhere around 40% of all online advertising revenue goes to ads on search listings today.

And as John Battelle says, its not clear that Google or anyone else can compete with Twitter at this point (Facebook’s giving it a solid try, though).

And it’s not just ads that can bring in the money. Brands need tools to make sense of all this data that Twitter doesn’t yet supply. Third parties like Scout Labs are going to be mining this data themselves, I’m sure. But there are lots of other ways Twitter can tax the utility they are bringing to brands. If they manage to turn down the acquisition offers like Facebook did a couple of years ago, there’s no reason Twitter can’t find revenue streams that will support them as a standalone company. Possibly even a public one.

Posted by pmfiorini on Jun 9 2009 in Social Media Marketing, Twitter

Bing – Microsoft’s new Search Engine

bing-logo

After several months in the planning, Microsoft has finally taken the covers off its new web search engine, Bing. Set to go live in under a week, Bing is not just a re branding of Microsoft’s previous search site Live Search but is a major update introducing new features and a new interface, touted as a “decision engine“.

Having been in internal testing for a while under the codename of Kumo, Bing was unveiled today – as expected – at the All Things Digital D7 conference by Microsoft CEO Steve Ballmer.

Bing is expected to start rolling out in the coming days with worldwide availability expected by June 3.
According to Microsoft, Bing will initially have four main search verticals: shopping around for products (with reviews and price comparisons to help you make your decision), travel planning (using technology from their acquisition of Farecast), researching health conditions (possibly linked to Microsoft HealthVault), and local business search (with integrated reviews and maps).

You may be wondering where such a strange name came from. Yusuf Mehdi, the Senior Vice President of the Online Audience Business Group who demoed Bing on stage at D7 today, reveals “We needed a brand that was as fresh and new – A name that was memorable, short, easy to spell, and that would function well as a URL around the world – the name needed to clearly communicate that this is something new, to invite you to come back, to re-introduce you to our new and improved service and encourage you to give it a try.”

Along with the relaunch, the Virtual Earth mapping platform will now be known as Bing Maps for Enterprise, the advanced travel search features made available from Microsoft’s acquisition of Farecast will be fully integrated as Bing Travel, and the Live Search cashback program will also be branded to Bing Cashback.

Will Bing be able to save Microsoft’s ever-dwindling search share? The product will have to seriously impress consumers and become an excellent brand if it is going to reach anywhere near Google’s search market and many believe that Bing could be aimed more at finally removing Yahoo! search from the competition. An advertising campaign for Bing, costing Microsoft up to $100 million, is expected soon as they try – yet again – to make larger inroads into the world of internet search.

Posted by pmfiorini on May 31 2009 in SEO Research, Tutorials

Google Wave – Facebook, Twitter, Gmail on Steroids

Your Gmail is about to undergo an extreme makeover- social networking style. Recent Google announced the release of Google Wave. Essentially, it’s kind of like Google’s version of Facebook, Twitter, Gmail on steroids but with real-time capabilities.

google-wave-i
The basic idea is that you create a wave and add people to it. Everyone on your wave can use richly formatted text, photos, gadgets, and even feeds from other sources on the web. They can insert a reply or edit the wave directly. It’s concurrent rich-text editing, where you see on your screen nearly instantly what your fellow collaborators are typing in your wave. That means Google Wave is just as well suited for quick messages as for persistent content – it allows for both collaboration and communication. You can also use “playback” to rewind the wave and see how it evolved.

Google’s multi-layered media format in the user interface provides users wit the tools for media collabration  and full editing controls to each participant.

Wave’s Primary features include:

  • Google Wave Concurrency: Natural language tools extending control technology provides real-time collaboration on a wave edit rich media at the same time.
  • Server-based models provide contextual suggestions and spelling correction.
  • Google Wave APIs:Embed waves in other sites or add live social gadgets.

Fans of Google’s other services and tools such as Analytics, Google Earth, Google Reader and Google News should welcome the Wave with open arms.No official launch date has been released, but you can sign up for the wave at wave.google.com.

Posted by pmfiorini on May 31 2009 in Google Wave

Google Wave & the Future of Marketing

Described by Google as “a new model for communication and collaboration on the web,” many industry pundits and technology Bloggers says it’s more like creating a bunch of independent online social networks that are based on a marriage of email and instant messaging. Each “page” or online social networking area is called a “wave.” Within it you can have conversations and share documents in real time. It’s not just about text either. The platform allows people to communicate and collaborate with any form of “rich media” (this includes text, photos, videos, maps and more). Any participant can reply and connect anywhere in the message as well as being able to edit the content and add participants. The waves also include a “playback” feature that allows people who may have joined later in the wave to “rewind” all of the content.

Is Google Wave the next generation of the live web?

While the platform is still in development (it’s looking like it will be publicly available later in the year), one of the major features and functionality that Google is promoting is how “live” the platform is. This includes a live transmission as you type (I seem to recall ICQ instant messaging having this feature as well) which will enable people to have faster conversations, see edits as they are happening and interact in real-time.

The platform is also pushing the ability to drag and drop items and make the Web a much more friendlier/easier place for everyone to connect, share, build and grow.

Is Google Wave good for Marketers?

It is way too early to tell, but there are some indications that if a platform like Google Wave does take off, it will fragment the concept of an online social network and splinter it down to a place where these areas are not used by masses to congregate and boast how many friends or connections they have, but perhaps the metric becomes how many waves individuals are engaged with and how active the conversation and collaboration is.

The platform obviously creates much more targeted inventory for advertising with the Google AdWords model (much like it does over at Gmail), but depending on how open or private these waves will be, this could also be one of those moments in time where people shift from having their opinions out in public, back into smaller, cozier and more personal conversations in a Google Wave.

Imagine brands inviting their consumers into a Google Wave – be it for customer service, product development or simply to discuss brand evangelism. This could become the highly personalized online social network many of us have been waiting for.

In the meantime, you can watch the hour-plus-long video of the unveiling of Google Wave right here:

Posted by pmfiorini on May 31 2009 in Google Wave

Google Wave Revolutionizes Email & Social Networking

Just the other day I was using my email and I found myself scoffing with disgust. “This is so last century!”

Okay, not really. But apparently down at Google Australia, that’s exactly what they’ve been thinking lately-and Lars and Jens Rasmussen and Stephanie Hannon came up with a way to revolutionize email and instant messaging called Google Wave. As Lars says, “Wave is what email would look like if it were invented today.”

google-wave-i

After a long demo, TechCrunch’s MG Siegler was inclined to agree with the seeming overstatement. Just reading about this new product is making my head spin. The integration of social and email here goes WAY beyond having a pane for GTalk in your Gmail.

The first two columns look pretty familiar if you’re used to the standard Gmail set up: the left-hand navigation has your folders and mailbox features as well as your GTalk contacts. The middle column has the inbox-but the difference here is that these aren’t individual messages, like you’d see in most mail clients, or even threaded “conversations” like you see in Gmail-these are the Waves that give the product its name.

How are Waves different from standard email? Well, for one thing you can communicate in not only “delay time,” like we do with email, but also real time (if you’re both online). And not just like IM, but see-as-you-type real time (though you can enable a “draft” feature if you want your friends to wait and see). Unlike email and even Gmail, you can click anywhere to start typing a reply to your friend’s messages-or other content, since you can include pictures, event invitations, games, maps, Wiki-style content and more.

Waves can also feature more than two people-just drag a friend’s photo from your contacts and drop it in the Wave to add them. They can sue the Playback feature to catch up on what you’ve been discussion.

Your head spinning yet? ‘Cause we’re just getting started.

Waves can remain private in your inbox or be published on the web, fully indexable by search engines. (They say that public waves are clearly marked as such in your inbox and in the wave itself.)

But that’s just the beginning of Wave’s portability. In the second phase of development, Waves will also integrate with other websites as a platform-for example, you could include a post from your blog in a Wave to discuss with friends, and have their comments in the Wave integrate with the comments on your blog (though all the details haven’t been hammered out on that one). Other commenters can also join in the wave.

And it’s not just blogs: the Google Wave team also sees lots of other kinds of sites using Wave for everything from customer service interface to contributor group chats.

And as if all that weren’t enough, Google’s also working hard with developers to make sure that the system is fully featured and ready for the masses. They have 50 internal Google developers who’ve created apps for Wave.

The APIs for Wave open tomorrow (tomorrow), but eventually the whole system is going open source as a protocol for its third phase. Waveprotocol.org has more details on that phase.

Which I know is making you wonder just when this is going to roll out. Google showed the launch at Google I/O, and though APIs are going to be available tomorrow, Wave itself is just a little ahead of its time. Google says its engineers are looking forward to HTML 5, which will enable Wave to operate within the browser without any necessary plugins (well, the “modern” browser, they say to exclude Internet Explorer).

And THAT is all. For now. You can sign up to be notified of the public launch at http://wave.google.com/.

So, if you’ve made it this far, what do you think? Are you salivating for the latest evolution of Internet communication, or are you shaking your fist at your monitor shouting “you crazy kids and your new fangled contraptions!”?

Posted by pmfiorini on May 31 2009 in Google Wave

Using the TinyURL API For Twitter – VB.NET Coding Example

If you’re a frequent Twitter user, we’ve all had the problem of space limitations due to long Urls since the length of the text message is 140 characters. If you don’t know about it yet, then there is a solution available!

TinyUrl.com

Ever heard of TinyURL.com? Well, basically, it’s a redirection service that gives you a short Url for your given your destination Url, which you can use in your web pages or emails. It has served many different purposes for years.

Typical reasons for its use to to shorten the Urls that are not only long enough to accommodate in limited spaces, it’s unlikely that users would be able to reproduce the long urls exactly by typing it without errors.

For example,

In Twitter, small Urls are preferred due to space limations

In emails blasts where long urls often get malformed and become non-functional. Tinyurls serve a good replacement for long urls.

For (casual) anonymity to users, such as for hiding affiliate links etc Tinyurls are mostly used.

TinyURL.com does not require you to create an account before starting with creating short urls. Just fill up the form with the long url and press the ‘Make TinyURL!’ button and instantly you get a short url that you can use in place of your given url. TinyURL now also allow an optional alias for your url which you can use to point to your page, given that the alias is not already taken.

So, the short link to an inventory page on one of our dealers (http://www.reedmantoll.com/new-inventory/vehicle-details.htm?vehicleId=75a132e44046381e01cc7e90761a4815&useHistory=true) is as small as http://tinyurl.com/422nlt!

That was all about TinyURL that most of you might have already known. Many developers wished if they could find a way to create TinyURLs without manually typing them, from within their online applications is actually quite easy to do in VB.NET.

It turns out that there is an API available and to make a request it’s as simple  as calling a page as below.

http://tinyurl.com/api-create.php?url=<your url here>

The output you get contains just one line containing the TinyURL corresponding to the url that you passed. I have already started using this API and am sure you are not far behind!

Here is an example using VB.NET:

   Private Function generateTinyUrl(ByVal url As String)
        Dim tinyUrlQuery As String = "http://tinyurl.com/api-create.php?url=" + url
        Dim tinyUrl As String = LTrim(RTrim(GetHTMLPage(tinyUrlQuery)))

        Return tinyUrl
    End Function

    Public Function GetHTMLPage(ByVal URL As String, _
      Optional ByVal TimeoutSeconds As Integer = 5, _
      Optional ByVal proxy As Integer = -1) _
      As String
        ' Retrieves the HTML from the specified URL,
        ' using a default timeout of 10 seconds
        Dim objRequest As Net.WebRequest
        Dim objResponse As Net.WebResponse
        Dim objStreamReceive As System.IO.Stream
        Dim objEncoding As System.Text.Encoding
        Dim objStreamRead As System.IO.StreamReader

        Try
            ' Setup our Web request
            objRequest = Net.WebRequest.Create(URL)
            objRequest.Timeout = TimeoutSeconds * 1000

            ' Retrieve data from request
            objResponse = objRequest.GetResponse
            objStreamReceive = objResponse.GetResponseStream
            objEncoding = System.Text.Encoding.GetEncoding( _
                "utf-8")
            objStreamRead = New System.IO.StreamReader( _
                objStreamReceive, objEncoding)
            ' Set function return value
            GetHTMLPage = objStreamRead.ReadToEnd()
            ' Check if available, then close response
            If Not objResponse Is Nothing Then
                objResponse.Close()
            End If
        Catch ex As Exception
            ' Error occured grabbing data, simply return nothing
            ' MessageBox.Show(ex.ToString)
            Return "Exception"
        End Try
End Function

Posted by pmfiorini on May 28 2009 in Tutorials