12 Apr 2002

Fri, 12 Apr 2002

What does the google API mean for regular folks?

DaveNet: What does the Google API mean for regular folks?  [Scripting News]


What does the Google API mean for regular folks? I'll tell you. It's relatively simple but there are some twists and turns along the way. What it means is that people like me are going to turn their attention to building rich, compelling user interfaces that don't rely on the browser to be rendered. Watch this space for more of that in the near future. We've been hearing about this forever but there hasn't been a lot of forward motion. That's all about to change, but there's a problem. You see, despite what everybody tells us about the web reducing our software distribution cost to zero, there's a dirty little secret hidden there. I know it, my dad knows it, the average computer user knows it.


Software installations on the web suck!


The future of the web described by the futurists will have a hard time taking off until that problem is solved completely, without compromise, full metal jacket. On the big company side, we've got Sun with Java web start and we've got Microsoft with whatever they're calling their copy of Java web start. Sun's solution requires me to download the solution before I get the benefits of automagic installation. The quandary is that installing the solution may be more painful than whatever came before it. No matter what anyone tells you, Java is never going to penetrate beyond the bounds of the digerati until it's on every PC out there by default, from the manufacturer. If there's a single thing that the DOJ could do to fairly even the score, it's to require a JVM on every copy of Windows shipped. But alas, it's probably to late for that solution to have any real impact since the installed base of PCs is so large. Microsoft, on the other hand, requires me to run all of their tools (particularly IIS, which makes me want to vomit). Then, the Microsoft OS du jour falls over after I install too much software on it. None of these alleged solutions is what it needs to be.


<Digression>


I read with some curiosity the ZD Net article explaining how IBM was going to buy Sun and assume control of Java and everything would be hunky dory because they get it after getting killed with OS/2!?! Riiiight. The problem with Java is that neither Sun nor IBM understand how to compete in a market space that is hyper-focused on user interface, or in politically correct terms, user experience. The really big problem, of course, is that software installation and configuration winds up being the work of interns that no self-respecting engineer would admit to doing and thus, we wind up with installers that are barely usable by engineers, let alone average folk who'd rather be watching Monday Night Football.


</Digression>


I built a command line interface to google using Visual Studio .net and C++ last night. I compiled and had all of the methods working cleanly in both debug and release builds on my XP box. I then proceeded to copy the executables to a Windows 2000 box and voila, it runs and produces the following output to every command:


0x0082039


Great! That's just the user experience I was hoping to give to my customers. I say to hell with dynamic links and the myriad of patches that Microsoft has put on top of the horribly broken dynamic linking system in Windows. I'm gonna static link everything. Now, if the open source folks would just come up with a compelling installation and configuration scheme, I'd be getting out my checkbook. Until then, I'll be suffering along trying to explain to mere mortals how to:


java -jar blah blah blah


when what I really want is:


Click hyperlink, BING!, running application.


The internet OS has a long way to go before that's possible. I'd love it if somebody sent me email and said, "but no, dave, the problem is solved already by wysiwyg widget wacker", but I'm not holding my breath.

Posted at: 22:39 | permalink

Jenny nails Hillary Rosen to the cross

Jenny nails Hillary Rosen to the cross


Go Jenny! Kill that little lawyer maggot!

Posted at: 15:40 | permalink

If the site seems slow

If the site seems slow


It's a Toshiba Infinia 200 MHz Pentium, 64MB RAM, 3GB disk, running linux. It's swapping quite a bit trying to keep up with the hit parade but I'm not sure what that looks like from Australia. It's big brother, the Toshiba Magnia, is sitting right here, but it's not quite ready for prime time. Maybe the next time I have a hit spike, I'll have it online so things don't bog so much.


Update: The hits have slowed and indeed the box has survived, never passing 50% CPU or 50 MB swap in use. I'm impressed.


Side Note On Radio and Hit Spikes


It would be really nice if radio had a feature like the big news sites where you could go in and hit a buttom and essentially dispense with all of the fat graphics and go to an alternate text only representation with a button click. That would make response times for readers during big hit spikes much better and it would allow people to run on a lot less hardware and bandwidth and still be able to handle the hit spikes.


After quite a bit of analysis I can see that there's a quantum link effect that you get when you wind up on scripting.com. Dave has awesome power in that regard.  I think his power may be even greater than the big news sites because of the intermingling effect of syndication, RCS, daypop, blogdex, google, google groups, and the google formula. I doubt he planned it that way, but the impact does not go unnoticed.

Posted at: 08:04 | permalink

Predicting the next mouse click, or lack thereof

Predicting the next mouse click, or lack thereof


Curiously, the click throughs to my pic site are about 100x the click throughs to my mp3 site. It remains a mystery.

Posted at: 07:39 | permalink

Scripting the Google API via C++ (Microsoft Visual Studio.net)

Scripting the google SOAP API via C++ (Microsoft Visual Studio.net)


Here's the next installment in my google SOAP API experiment. I have the major stuff working in a win32 C++ console application. You can get the project files, source, and binaries here. Too tired too say much about it but it works even though it's not iron-clad. I'd like to put the typical while loop and take the commands interactively like a real shell but ran out of steam. If you do that, please send me the updates. Thanks.


/*


PROGRAM: GoogleShell.cpp
AUTHOR:  David Watson
CONTACT: http://davidwatson.org:8086/
DATE:    April 11, 2002
PURPOSE: Define a win32 console application for calling Google's SOAP API.


Copyright (c) 2002 David Watson


Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


*/


#include "stdafx.h"
#include "GoogleSearchService.h"
#include <iostream>
#include <string>


class CCom
{
private :
    HRESULT m_hr;


public:
    CCom() : m_hr(E_FAIL)
    {
    }


    HRESULT Initialize()
    {
        ATLASSERT(FAILED(m_hr));
        return m_hr = CoInitialize(NULL);
    }


    ~CCom()
    {
        if (SUCCEEDED(m_hr))
            CoUninitialize();
    }
 
 static bool SoapSuccess( HRESULT hr)
 {
        if (FAILED(hr))
        {
            std::wcout << L"0x" << std::hex << hr;
            return false;
        }
        return true;
 }


};


int _tmain(int argc, _TCHAR* argv[])
{
    using namespace GoogleSearchService;
    using namespace std;


    if ( argc < 4 )
    {
       cout << "usage: GoogleShell key [page, search, spell] [\"url\", \"search string\", \"spelling word\"]" << endl << endl;
       cout << "example: GoogleShell \"7ei2nf9e8wn3s7dhjr8dnr8e72lednd7\" page \"http://davidwatson.org:8086/\"" << endl;
       cout << "example: GoogleShell \"7ei2nf9e8wn3s7dhjr8dnr8e72lednd7\" search \"david watson\"" << endl;
       cout << "example: GoogleShell \"7ei2nf9e8wn3s7dhjr8dnr8e72lednd7\" spell \"britney spars\"" << endl;
       return 0;
    }


    CCom COM;
    HRESULT hr = COM.Initialize();
    if (SUCCEEDED(hr))
    {
        CGoogleSearchService service;
        CComBSTR bstrResponse;
        GoogleSearchResult retVal;
        ATLSOAP_BLOB blob;
        wstring command ( static_cast<const wchar_t *>(CComBSTR(argv[2]) ));
        wstring SPELL ( L"spell" );
        wstring SEARCH ( L"search" );
        wstring PAGE ( L"page" );
  
        if ( command == SPELL)
        {
            if (CCom::SoapSuccess(service.doSpellingSuggestion(CComBSTR(argv[1]), CComBSTR(argv[3]), &bstrResponse)))
            wcout << static_cast<const wchar_t*>(bstrResponse);
        }
        else if (command == SEARCH)
        {
            if (CCom::SoapSuccess(service.doGoogleSearch(CComBSTR(argv[1]), CComBSTR(argv[3]), 0, 10, false, CComBSTR(L""),false,CComBSTR(L"lang_en"),CComBSTR(L"latin1"),CComBSTR(L"latin1"), &retVal)))
            for(int i = retVal.startIndex; i < retVal.endIndex; i++)
                wcout << static_cast<const wchar_t*>(retVal.resultElements[i].title) << endl;
        }
        else if (command == PAGE)
        {
            if (CCom::SoapSuccess(service.doGetCachedPage( CComBSTR(argv[1]), CComBSTR(argv[3]), &blob)))
                wcout << static_cast<const wchar_t*>(CComBSTR(blob.size,(LPCTSTR)blob.data)) << endl;
        }
    }
    return 0;
}

Posted at: 02:16 | permalink