March 4, 2010

Choose Your Web Browser

Filed under: General,Web/Tech — Marcus Tettmar @ 10:39 am

One of my Windows XP systems installed an automatic update last night when I shut it down.  This morning I was presented with this:

Windows EU WebBrowser Choice

As I understand it this is as a result of an EU competition law decision.   Is this a good thing or a bad thing?

On the one hand it seems a waste of money and illogical.

I’m no fan of IE, but why shouldn’t Microsoft build a web browser and make it part of their operating system?  Should the EU force them to offer a choice of text editors, calculators, paint programs and calendar applications too? Where should it end?

Plus, yet another dialog like this is surely going to confuse the ordinary user.  Many have no idea what a “web browser” is and just call it “My Internet” or “Google”.  The dialog preceding the one above has to go to the trouble of explaining what a web browser is.  And isn’t the user just going to take the first option anyway?  In which case should the EU force Microsoft to make IE8 something other than the default option?

But then if I were trying to sell a web browser I guess I would welcome this decision. It might give me a little extra exposure.

What do you think?

January 29, 2010

Running Macro Scheduler Macros over the Web Via PHP

Filed under: Automation,General,Scripting,Web/Tech — Marcus Tettmar @ 9:31 am

Here’s a quick and simple proof of concept for running Macro Scheduler macros via the web and having their output displayed in the user’s browser:

Running Macro Scheduler Macros Over the Web Via PHP

The screenshot shows the PHP script, Macro Scheduler script and Internet Explorer being used to run the macro.

1) If you don’t already have a Windows based web server with PHP running, download and install WAMPServer. It’s easy.

2) Create a simple PHP script which takes an EXE name as a parameter and any parameters you want to pass to it. The following script will run EXEs that are in the c:\wamp\ folder, passing in any parameters provided and will dispay the EXEs output.

<?php
$exe = $_GET['exe'];

$dir = "c:\\wamp\\";

$parms = "";
foreach($_GET as $key=>$val) {
  $parms .= "/$key=$val ";
}

echo shell_exec("\"$dir$exe\" $parms");
?>

3) PHP’s safemode must be disabled for this script to work.

4) Create a Macro Scheduler macro and use SOWrite or SOWriteLn to output information. Compile it with the “Create Console App” option checked. Compile the EXE (or copy it) to the c:\wamp\ folder.

5) Now the macro can be executed via the web using http://servername/runmacro.php?exe=my.exe&parm1=value&etc=… which could be a link or entered into the browser directly.

6) Consider adding further security to the script to prevent anyone running any EXE on your server, or putting it in a password protected folder. I’ll leave that to you.

Macro Scheduler Enterprise comes with the msNet Remote Controller which includes a CGI module for running Macro Scheduler macros via web servers.

April 20, 2009

Twittering from Macro Scheduler with the Twitter API

Filed under: Scripting,Web/Tech — Marcus Tettmar @ 7:42 am

Way back in the deep and distant past when the Internet was new and Bill Gates thought it was just a passing fad, I remember reading about a Cola vending machine on a University campus that some frivolous young boffins hooked up to the ‘net so that you could check its inventory from anywhere in the world using an old fashioned network command called “finger”. Why? Because they could.

Fast forward to the technologies of the current day and the latest trend of Twitter, and history is repeating itself. In the last week I’ve read about a restaurant that can take orders via Twitter, a bakery tweeting the emergence of fresh loaves from the oven; and, utterly pointless, some guys who created a system which sends a tweet every time their cat enters or exits its cat flap. Why? Well, because they can I guess.

Not wanting to be left out I decided to write some Macro Scheduler code to tweet status updates and monitor replies. Why? Well there might be a good reason for being able to do this – I’m sure someone will have one. Perhaps you have a client who wants you to set up a system to monitor the movement of his cat, process restaurant orders, or your local baker wants an automated fresh-loaf tweeter! But mostly, it’s because we can.

You’ll find the Twitter API documentation here. Here’s the code to Tweet a status update:

Let>username=YOURTWITTERNAME
Let>password=YOURPASSWORD

//Tweet from Macro Scheduler
Let>url=http://%username%:%password%@twitter.com/statuses/update.xml
Let>message=Kitty just left the buildng
HTTPRequest>url,,POST,status=%message%,result

Being serious for a moment I can see how a macro that monitors an application might want to post status updates to Twitter, or a backup script could alert you by Twitter when there’s a problem. It might be a public system, but don’t forget that Twitter profiles can be made private too, and Tweets can be viewed on and sent from your BlackBerry, iPhone, or even by SMS.

The following script sets up a loop which monitors your Twitter stream for “mentions” of your username. This might form the basis of a script which retrieves orders. Perhaps it could listen to Twitter for commands and carry out actions based on what message was sent. Or perhaps you just want a macro which does something when a cat decides to head out for the night. Use your imagination.

Let>username=YOURTWITTERNAME
Let>password=YOURPASSWORD
Let>ini_file=%SCRIPT_DIR%\twit.ini
Let>_delay=30

VBSTART
VBEND

//monitor twitter username "mentions" loop
Label>monitor_loop

Let>url=http://%username%:%password%@twitter.com/statuses/mentions.xml
HTTPRequest>url,,GET,,result

//remove the  portion (I don't need it and it avoids distinguishing the text IDs from the user IDs.
RegEx>[^>](.*?),result,0,user_matches,nf,1,,result

//extract all texts
RegEx>(?<=)[^>]*?(?=),result,0,text_matches,num_texts,0
If>num_texts>0
  //extract all ids
  RegEx>(?<=)[^>]*?(?=),result,0,id_matches,num_ids,0

  //get last known
  Let>last_known_id=0
  IfFileExists>ini_file
    ReadIniFile>ini_file,SETTINGS,LAST_ID,last_known_id
  Else
    WriteLn>ini_file,wlnr,
  Endif

  //iterate through texts
  Let>k=0
  Repeat>k
    Let>k=k+1
    Let>this_id=id_matches_%k%
    If>this_id>last_known_id
      Let>msg_text=text_matches_%k%
      /*
      msg_text contains the message 
      Use your imagination here!
      For now we'll show it in a message
      */
      MessageModal>msg_text
    Endif
  Until>k=num_texts

  //store last ID
  EditIniFile>ini_file,SETTINGS,LAST_ID,id_matches_1
Endif

Wait>_delay
Goto>monitor_loop

The script retrieves the 20 most recent “mentions”. It stores the last seen ID in an INI file so that on the next check it ignores those it has seen before, only retrieving messages with a larger ID number.

This is a quick and dirty solution with no error checking, using RegEx to parse the XML that is returned by the call to Twitter. You may prefer to use the MS XML object as shown here.

Whether this proves useful or completely pointless, I hope you have fun. If you’re using Macro Scheduler with Twitter, please add a comment below to let us know how … and why!

Don’t forget you can follow me on Twitter where I may occassionally say something useful.

March 23, 2009

It’s time to bring down IE6!

Filed under: General,Web/Tech — Marcus Tettmar @ 12:12 pm

Bring Down IE6

Some of you may remember that we had some issues with Internet Explorer 6 support when we released our new web site. I made some negative comments about IE6. And I was being polite. Unfortunately IE6 is still in use in millions of companies and, as I mentioned in that last post, some 35% of our web traffic is delivered by people using IE6. If it were up to me I’d banish it to web browser hell.

So I’m all for a new campaign from .Net magazine: Bring Down IE6.

If you have the power to do so, upgrade now, or try out Firefox or Google Chrome . If you’re working for a company that locks down their PCs and forces you to use IE6, get vocal – educate your colleagues and IT department. Petition them to lift you out of the dark ages! 🙂

Check out the site to see how you can get involved.

February 5, 2009

Twitter – What, Why, How?

Filed under: General,Web/Tech — Marcus Tettmar @ 2:20 pm

If you’re one of those who has heard of Twitter but just doesn’t quite “get it” yet you should find Scott Hanselman’s How To Twitter – First Steps and a Twitter Glossary useful. It explains what Twitter is, why it’s useful and how to tweet.

I didn’t get it at first. I wasn’t quite sure what I would get out of it. Most people who now use Twitter regularly were probably the same to begin with. Now I realise how useful it is. I follow friends, people and companies that I find interesting and I want to stay up to date with. I follow news sites like the BBC and CNN. I probably get most of my news via Twitter now (In our house the TV seems to be permanently tuned to Nick Jr these days!). Most of the bloggers I read now tweet their blog updates, so I no longer need to monitor their RSS feeds.

It’s useful. It’s fun too. Even if you don’t have anything to say, you can get a lot out of following people that interest you. And, as Scott says, the nice thing is if you want to respond you can just jump in and reply to anyone.

So if you’ve been wondering what all the fuss is about, read Scott’s blog post, jump in and join the conversation. You can start by following me. My twitter ID is http://twitter.com/marcustettmar 🙂

October 19, 2006

Firefox2 or IE7?

Filed under: Web/Tech — Marcus Tettmar @ 5:33 pm

I see IE7 has been released. Haven’t installed it yet, but I do have an early beta version running on another PC and found that a bit clunky. I’m a Firefox fan though, so I’ve just downloaded and installed Firefox 2 RC3. I like it. The interface has been given a subtle update but it is also noticeably faster. I really like the built in spell check. I used to use the Google toolbar to spell check my posts, when I remembered – I invariably forgot! So having spell check built in is a great improvement. Now I just need to change the dictionary from US English to British English! 🙂

You can download Firefox 2 RC3 here.

August 25, 2006

A Few Search Tips

Filed under: General,Web/Tech — Marcus Tettmar @ 2:26 pm

In my last post I said I would provide some tips on getting the best out of Google Groups and finding what you’re looking for. But first off let’s start with a few general search tips. Google themselves provide some helpful guides on using the regular Google search engine:

Basic Tips:
http://www.google.com/help/basics.html

Advanced Search:
http://www.google.com/help/refinesearch.html

These guides are well worth reading. There’s lots of stuff on the Advanced Search page that are easy to overlook and can be very helpful in narrowing down your search. For example, you can limit your search to a particular domain. I often use this for searching for answers on Microsoft’s site. E.g.:

“not allowed in this context” site:microsoft.com

Note that the advanced search simply adds information to the regular search query. To search within a domain it simply adds the “site:” attribute to the search term. You can add this yourself in the regular search box. You can also exclude results from certain sites:

“Macro Scheduler” -site:mjtnet.com

Note the use of the quote marks to search for a specific phrase. In my first example above I wanted to find pages on microsoft.com that contained this error message. So I needed to use the quotes.

Google Groups searches Usenet messages. It works in much the same way as Google. But since Usenet consists of a huge array of groups spanning all manner of topics it is often necessary to narrow your search down to within certain groups. Consider this Google Groups search:

create recordset

The first page of results consists of messages from various groups covering VB, SQLServer, MS Access, Dreamweaver and Ultradev. What I really want to do is find out how to create a record set in VBScript. In much the same way the regular Google search lets you search within specific domains, you can search within specific groups:

create recordset group:microsoft.public.scripting.vbscript

This searches only within the microsoft.public.scripting.vbscript newsgroup. But there are other groups that discuss VBScript. And what if you don’t know what they are called? Well, you can use wildcards:

create recordset group:*vbscript*

This returns a much more targeted, useful set of results from various VBScript groups. Definitely my most used search construct.

Hope this helps!

August 24, 2006

Usenet – My Best Kept Secret

Filed under: General,Web/Tech — Marcus Tettmar @ 10:18 am

In a way I feel I’m about to blow my own cover with this post. But I’m pretty sure many people will find this really useful. I seem to have a reputation for knowing everything. People always come to me with their computer problems and I’m nearly always able to find a solution. When I help Macro Scheduler customers with obscure VBScript, ODBC, or Win32 API, issues they often ask “How the hell do you know this stuff?”.

The truth is I very often don’t have the answers immediately. Sometimes a support ticket will come in or I’ll see a forum post and I’ll be no more able to answer it than anyone else. But I have my secret weapons. And the fact is anyone else can use them too.

My favourite and most useful resource is Usenet. I take Usenet for granted, but I’ve realised lately that many people these days don’t know what Usenet is. Usenet is an email like distributed discussion system that was invented at Duke University (North Carolina, USA) by two graduate students in 1979. Yes, you heard that right, the best resource for answering technical questions for state-of-the-art problems is 27 years old! With Usenet, users read, post and reply to messages to a huge number of ‘newsgroups’ on all manner of topics. Newsgroups are distributed across ‘news servers’ throughout the Internet. Most ISPs have a news server that their subscribers can access.

Usenet is home to all sorts of weird and wonderful topics. Discussions of all sorts take place in Usenet. There are literally thousands and thousands of groups. Many I’d rather have nothing at all to do with! But Usenet is also the domain of programmers, technical whizkids and geeks of all varieties. And since it has been around for so long there’s almost no technical issue, programming problem or computer scenario that hasn’t been discussed at some point. So it is the perfect place to go to find out how to build that bit of VBScript, use a Win32 API function, or fix a problem in XP.

But Usenet is a bit tricky to use. You need to be able to access a news server and then you need a news reader, which is like an email client. You need to subscribe to relevant groups and then you get overwhelmed as thousands of posts pour in. And then somehow you need a way to search the content.

So Usenet is great for day to day discussions, but how do you tap this resource as a knowledge base? Well you may have heard of a company called Google. A while back Google bought a system called Deja News which archived every Usenet post since 1981. The system is now called Google Groups. It continues to archive Usenet postings as well as Google’s own web based discussion groups. It can be accessed at groups.google.com. As you probably know, Google is quite good for searching for stuff. Google Groups is no different. It combines the power of Google’s search with the massive resource of Usenet. With Google Groups you can search for pretty much any technical matter you need help with. And 99% of the time you’ll find an answer, often from a technical guru who knows his stuff, or someone who has had the same problem already.

I find that people tend to turn to Google, or one of the other search engines, to try to find answers. But specific technical questions can be hard to locate on Google, because Google indexes web sites, and even if the issue is dealt with by a web site it may be hidden deep within it’s bowels. So a web search engine isn’t always the best way to find answers to technical problems. In contrast Google Groups indexes only messages that people, like geeks and programmers, have written, and so it gets straight to the crux of the matter. It’s also instant. Pretty much as soon as a Usenet message is posted, it shows up in Google Groups. In contrast a web site can take months before it is fully indexed. So Usenet is often more up to date on technical matters.

As an example you will probably find more discussion of Vista technical issues and Vista specific programming techniques in Usenet than anywhere on the web. Long before Vista is released, beta testers, Microsoft experts and C++ gurus have been discussing such concepts via Usenet for months. And you can find this stuff now with Google Groups.

So now you know! I’m not such an expert after all. I just know where to find the answers. In my next post, I’ll explain how to get the most out of Google Groups and give you some tips on how to search and narrow down on what you’re looking for.

June 12, 2006

Automated Google Rank Checker

Filed under: Automation,Scripting,Web/Tech — Marcus Tettmar @ 10:43 am

I’ve just had a bit of fun writing a couple of small scripts that will search Google for a set of key phrases and find the position of a specified URL for those key phrases in the results. I have built two versions of this script. One with a simple dialog where you can enter a URL and key phrase to search for, and another which takes a set of key phrases in an input file and produces a CSV file with the results and date. This second script can be scheduled to take place every night. The CSV file will grow with the new results and can be opened in Excel and a chart produced showing the trend over time of your website position for those key phrases.

As well as being extremely useful as an automated way to monitor the performance of your keywords in Google, these scripts also demonstrate what can be done with some simple Macro Scheduler scripting and WebRecorder. The scripts are not long and give a glimpse at the sort of things WebRecorder and Macro Scheduler can do to automate web sites and parse the resultant HTML.

Download the scripts here:
http://www.mjtnet.com/usergroup/viewtopic.php?t=2983

Note that these scripts automate IE and therefore operate at the user level just as if you were using Google yourself.

March 3, 2006

Origami – what is it?

Filed under: Web/Tech — Marcus Tettmar @ 3:18 pm

There’s a lot of hype at the moment over what Microsoft’s Origami device is going to be. As far as I can see so far it looks like it’s going to be a small handheld/tablet PC. Somehow I wonder if the device will live up to the expectations the hype is generating. Especially as the concept is nothing new. I’ve already got my eye on this little fellow: OQO Ultra PC. This solves the problem that most small computers have – the lack of a qwerty keyboard. I’m always answering emails on the move and I used to use a Pocket PC – but, what a nightmare without a real keyboard. So, recently I purchased this HP iPAQ hw6510 which has a small qwerty. It makes a real difference. It’s really good for answering emails, and even, despite the small screen, surfing the web – and it is a phone too – so I don’t need to carry around two devices. But because it is Windows Mobile I can’t run stuff like Macro Scheduler on it – which means I can’t test things out until I get back to a regular PC. So I’m now drooling over this OQO which runs full Windows XP Pro. It would let me put my whole office in my pocket. I wonder how the Origami will compare. Will it be worth the hype? Scoble thinks not:

“There’s no way this thing is going to be able to meet the expectations of the hype being placed on it.”

« Newer Posts