So let's say there is a series of web pages or other text you can view in Firefox. Each of these has a different text. But these sections of text are formatted similarly, that is to say, they each begin with the same phrase and end with the same phrase. I say 'phrase', not 'html code'. If I wanted to copy the text in these sections (as it's presented in Firefox), the only way I know to do this is manually, i.e. open each page and manually copy/paste. Is there a way to, say, open them all in multiple tabs, and tell Firefox to copy all the text between the identical beginning/end phrases?
I mean a plugin, I suppose. I'm not sure a clipboard utility would be able to ignore the html code, but if it can, then that too.
Last edited by nest0r (2010 April 04, 3:23 pm)
Asriel
Member
From: 東京
Registered: 2008-02-26
Posts: 1343
There is (was?) a program I had a while ago, where you would tell it to perform certain "routines," and I'm pretty sure that you could do this.
You hit "record," and it would remember everything you did, and then you could just run the script, and it would do it. You could set more commands in the code (which, IIRC, were specific to the program), so I can't imagine it would be too hard to make it do something like:
while (Firefox's window has open tabs) {
find("Identical Beginning Phrase")
copy(text until "Identical Ending Phrase")
close(current tab)
}
Keep in mind, that is NOT anything near to the code you will probably be using. Just an example of what I think you'd be able to use.
Give me a few minutes, and I'll see if I can find the program again.
Asriel
Member
From: 東京
Registered: 2008-02-26
Posts: 1343
Unfortunately, I'm on a Mac, and have long since gotten rid of my virtual machine with Windows installed on it..
I'm pretty sure it could do what you want, because what I was using it for before was copying text that appeared in programs into notepad, and then refreshing Firefox every time the notepad file, so I could follow along, using Rikaichan as I needed.
I'll look into it and see if I can help you from the mac-side of things, anyway...
balloonguy wrote:
Here's something that works. Right click on a page and click copier. It will prompt for a start word and end word and will apply this regex to all the tabs:
/\bstring1\b([\s\S]*?)\bstring2\b/
and put the results on the clipboard separated by a newline.
Awesome! I'm having a problem though, I think the clipboard doesn't have enough memory? I'm hoping it will still work with a replacement clipboard extender thingy?
As it stands, I tried copying a batch of text and pasting it but nothing happened, even though it worked for a smaller amount. I looked at the default Win clipboard and it said not enough memory or somesuch.
Woohoo! Works now. No idea why though. Hmm, it happened after I cleared my Firefox cache on an instinct...
Thanks guy, you are the... Guy.
Edit: Ohhhh, it's case sensitive?
Edit 2: Yes, this is extremely useful. In fact, I think it might be even more useful beyond my original goals that I haven't thought of yet.
Last edited by nest0r (2010 April 07, 9:53 pm)
By the way, know how to get this to work for the View Source stuff? I have a plugin that lets me view source/view source selection in tabs, but the copier thingy gets befuddled by newlines or something.
If it takes more than 5 seconds to think of a solution, don't worry about it, it's not a big deal, just a random thought that popped into my head and I couldn't resist commenting about.
Last edited by nest0r (2010 April 08, 9:23 pm)