mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Information & Answers (https://www.mersenneforum.org/forumdisplay.php?f=38)
-   -   Program (https://www.mersenneforum.org/showthread.php?t=12162)

Primeinator 2009-07-16 19:04

Program
 
Does such a program exist that enters a user-given input into a field on a website automatically (like a macro) but does it to a large number of sites at the same time? I'm looking for a simple version of this for an older gentleman at my church who has a book business and likes to input the ISBN numbers into about two dozen sites to check availability and pricing. Thanks

Mini-Geek 2009-07-16 19:30

If nothing else, it ought to be quite simple to make a JS, PHP, .Net, etc. page where you enter the ISBN and it gives you the links you want. Or you could write a [URL="http://labs.mozilla.com/projects/ubiquity/"]Ubiquity[/URL] command (if the guy uses Firefox, or wouldn't mind switching to it, at least for his ISBN lookups) where you give it an ISBN and it opens all of the appropriate links in new windows/tabs.

Primeinator 2009-07-16 19:41

I know no coding. How would it be done on Ubiquity? I looked at the app briefly.

Mini-Geek 2009-07-16 20:02

[quote=Primeinator;181289]I know no coding. How would it be done on Ubiquity? I looked at the app briefly.[/quote]
Here's the command you'd use: (modified to have the sites he wants, of course, the ones there aren't going to do anyone much good!)[code]CmdUtils.CreateCommand({
name: "ISBN",
arguments: [{role: 'object', nountype: noun_arb_text}],
locale: "en-US",
description: "Lookup availability and pricing for the given ISBN number.",
preview: function(pblock, args) {
var html = _("Lookup ISBN number.");
if (args.object.text) {
html = _("Lookup ISBN number " + isbn);
}
pblock.innerHTML = html;
},
execute: function(args) {
var isbn = args.object.text
Utils.openUrlInBrowser("http://example.com/lookup?isbn=" + isbn);
Utils.openUrlInBrowser("http://example2.com/lookup?isbn=" + isbn);
//etc
}
}); [/code]Or more minimalist, but still just as functional:[code]CmdUtils.CreateCommand({
name: "ISBN",
arguments: [{role: 'object', nountype: noun_arb_text}],
execute: function(args) {
var isbn = args.object.text
Utils.openUrlInBrowser("http://example.com/lookup?isbn=" + isbn);
Utils.openUrlInBrowser("http://example2.com/lookup?isbn=" + isbn);
//etc
}
});[/code]Note that both of these commands were written for [URL="http://labs.mozilla.com/2009/07/ubiquity-0-5/"]Ubiquity 0.5[/URL], (consider it a stable beta release, it's not what you'll get if you just use the link on the main Ubiquity page) which requires Firefox 3.5. This shouldn't be a problem, but if you want to use the 0.1 line for some reason, the command can be converted fairly easily, just reverse [URL="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2_API_Conversion_Tutorial"]this tutorial[/URL].
Only problem is that any sites where the ISBN number doesn't appear in the URL (sent as POST instead of GET) will be trickier. I don't know exactly how to do that and make it work. Here's a tip, if any of the sites do use POST instead of GET: Google. It's just JS code, so a JS solution to bringing up a page with POST parameters ought to work. Probably not too hard, but I've never done it.

Primeinator 2009-07-16 21:22

Would a macro not be easier? 90% of what you just said was well over my head. He is running Windows XP and if I could find a site for a good macro then I could train it myself (record for it what I would want it to do) because then the macro would run MUCH faster than I was able to manually enter the ISBN onto all two dozen or so sites.

Mini-Geek 2009-07-16 21:42

[quote=Primeinator;181302]Would a macro not be easier? 90% of what you just said was well over my head. He is running Windows XP and if I could find a site for a good macro then I could train it myself (record for it what I would want it to do) because then the macro would run MUCH faster than I was able to manually enter the ISBN onto all two dozen or so sites.[/quote]
I don't know how much difficulty a macro is, but this way is actually quite easy.
To prep you have to:
[LIST=1][*]be using Firefox 3.5[*]install Ubiquity 0.5[*]copy/paste the code (with the URLs filled in correctly, which won't be too hard) to the Hack Ubiquity page (a link for it is in the top right of the page it loads after you install Ubiquity)[/LIST]Then to use it:
[LIST=1][*]Press Ctrl+Space[*]type/paste "isbn 1234567890" or whatever[*]press enter.[/LIST](optionally, also learn how to use Ubiquity. It gives you a link to an easy tutorial on the page that comes up after it's installed)


All times are UTC. The time now is 01:04.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.