ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > FARR Plugins and Aliases

Farr Plugin Idea Again: Generic web page retrieve with regex show

(1/2) > >>

mouser:
This request goes out to czechboy and ecaradec who have been doing javascript plugins lately.

I don't know if ecaradec's plugin supports this yet, but one thing you can do with plugins that people haven't been using yet is you can let an alias call a plugin directly.  This isn't really much different than calling it when someone types something in but if you read my suggestion you'll see why i mention it.

I think it would be really useful to have a generic plugin that was meant to be called from alieses.

Here's what the plugin would do, it would be invoked like this:

webgrab URL "regexgrab" "outputformat"

This would cause plugin to
1. grab the page at URL
2. Match text regexgrab with pattern group matching
3. Display memo result of outputformat doing replacement of matched groups

This webgrab function is generic function that anyone could write aliases for.

So for example i might write an alias like this:
Alias: wtemp (.*)
Invokes: webgrab.dll webgrab http://www.weather.com/weather/local/$$1 "Feels like (.*)F" "Weather in your town is %1 degrees"

using this alias would cause the webgrab plugin to:

1. grab the page at http://www.weather.com/weather/local/61820
2. Match text Feels like (.*)F
3. Display memo result of Weather in your town is %1 degrees (where %1 is the regex pattern match in step 2)

Hope its not too confusing to see the dual use of regular expressions and replacement..
Basically the alias has its own regex match which grabs the users zipcode that they type,
And then the second use is when telling the webgrab plugin how to match and display results.


The idea is that this one plugin could be used by lots of people to make and share different aliases that could grab all kinds of info from web pages.

jgpaiva:
I see this idea, looks really cool!

I have another suggestion: how about if it accepted several trios webpage regex1 display and displayed each on its own line?
This way, we could have a bunch of predifined cities when people wrote "weather", and the first one would be the one people typed in.

nitrix-ud:
Very good idea !  :D

concerning webpages, i'm still waiting for the showmemo command to be able to display webpages, that would be great too  :P

mouser:
dc member ewemoa has a working version of this plugin that i have been testing.  it's EXTREMELY cool.  :up: :up:

ewemoa:
A preliminary version should be available for interested parties :)

Navigation

[0] Message Index

[#] Next page

Go to full version