mersenneforum.org Program
 Register FAQ Search Today's Posts Mark Forums Read

 2009-07-16, 19:04 #1 Primeinator     "Kyle" Feb 2005 Somewhere near M50..sshh! 2×3×149 Posts 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
 2009-07-16, 19:30 #2 Mini-Geek Account Deleted     "Tim Sorbera" Aug 2006 San Antonio, TX USA 17·251 Posts 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 Ubiquity 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. Last fiddled with by Mini-Geek on 2009-07-16 at 19:30
 2009-07-16, 19:41 #3 Primeinator     "Kyle" Feb 2005 Somewhere near M50..sshh! 2·3·149 Posts I know no coding. How would it be done on Ubiquity? I looked at the app briefly.
2009-07-16, 20:02   #4
Mini-Geek
Account Deleted

"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17·251 Posts

Quote:
 Originally Posted by Primeinator I know no coding. How would it be done on Ubiquity? I looked at the app briefly.
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
}
});
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
}
});
Note that both of these commands were written for Ubiquity 0.5, (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 this tutorial.
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.

Last fiddled with by Mini-Geek on 2009-07-16 at 20:18

 2009-07-16, 21:22 #5 Primeinator     "Kyle" Feb 2005 Somewhere near M50..sshh! 15768 Posts 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.
2009-07-16, 21:42   #6
Mini-Geek
Account Deleted

"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17·251 Posts

Quote:
 Originally Posted by Primeinator 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.
I don't know how much difficulty a macro is, but this way is actually quite easy.
To prep you have to:
1. be using Firefox 3.5
2. install Ubiquity 0.5
3. 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)
Then to use it:
1. Press Ctrl+Space
2. type/paste "isbn 1234567890" or whatever
3. press enter.
(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)

Last fiddled with by Mini-Geek on 2009-07-16 at 21:44

 Similar Threads Thread Thread Starter Forum Replies Last Post jasong GPU Computing 19 2011-08-23 03:32 rogue Lounge 5 2009-10-02 15:02 tribal Information & Answers 5 2009-03-19 20:54 moo Software 0 2006-06-27 00:19 drakkar67 Prime Sierpinski Project 14 2005-11-29 06:25

All times are UTC. The time now is 00:45.

Wed Oct 28 00:45:51 UTC 2020 up 47 days, 21:56, 2 users, load averages: 1.91, 1.99, 1.93