mersenneforum.org  

Go Back   mersenneforum.org > New To GIMPS? Start Here! > Information & Answers

Reply
 
Thread Tools
Old 2009-07-16, 19:04   #1
Primeinator
 
Primeinator's Avatar
 
"Kyle"
Feb 2005
Somewhere near M52..

2×33×17 Posts
Default 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
Primeinator is offline   Reply With Quote
Old 2009-07-16, 19:30   #2
TimSorbet
Account Deleted
 
TimSorbet's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

10B716 Posts
Default

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 TimSorbet on 2009-07-16 at 19:30
TimSorbet is offline   Reply With Quote
Old 2009-07-16, 19:41   #3
Primeinator
 
Primeinator's Avatar
 
"Kyle"
Feb 2005
Somewhere near M52..

2×33×17 Posts
Default

I know no coding. How would it be done on Ubiquity? I looked at the app briefly.
Primeinator is offline   Reply With Quote
Old 2009-07-16, 20:02   #4
TimSorbet
Account Deleted
 
TimSorbet's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

427910 Posts
Default

Quote:
Originally Posted by Primeinator View Post
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 TimSorbet on 2009-07-16 at 20:18
TimSorbet is offline   Reply With Quote
Old 2009-07-16, 21:22   #5
Primeinator
 
Primeinator's Avatar
 
"Kyle"
Feb 2005
Somewhere near M52..

11100101102 Posts
Default

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.
Primeinator is offline   Reply With Quote
Old 2009-07-16, 21:42   #6
TimSorbet
Account Deleted
 
TimSorbet's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

427910 Posts
Default

Quote:
Originally Posted by Primeinator View Post
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 TimSorbet on 2009-07-16 at 21:44
TimSorbet is offline   Reply With Quote
Reply

Thread Tools


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

All times are UTC. The time now is 06:02.


Sat Sep 23 06:02:28 UTC 2023 up 10 days, 3:44, 0 users, load averages: 0.88, 0.95, 0.93

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔