topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 2:33 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: FARR html view  (Read 7312 times)

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
FARR html view
« on: August 13, 2009, 01:33 PM »
Is there an option to run some javascript to parse a webpage before it is displayed? For example I want to check the weather forecast from http://www.weather.c...veler/local/HRXX0005, but I want to extract only the relevant data.
Something like greasemonkey for FARR :)
It is impossible to make anything foolproof because fools are so ingenious.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR html view
« Reply #1 on: August 13, 2009, 03:07 PM »
czb has done this in some of his plugins, but i agree that it would be a great idea to make a more general plugin that allowed users to fetch web pages and extract certain info.. in fact i know someone worked on this.. i just can't remember the current status of it.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: FARR html view
« Reply #2 on: August 13, 2009, 03:33 PM »
In the meantime bbc weather has an embed option that lets you easily use FARR. Just put <iframe src="http://news.bbc.co.u...xhtml?target=_parent" allowTransparency="true" width="306" height="435" frameborder="0">You must have a browser that supports iframes to view the BBC weather forecast</iframe> to a blank html file and use that in an alias.
It is impossible to make anything foolproof because fools are so ingenious.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: FARR html view
« Reply #3 on: August 13, 2009, 05:01 PM »
skajfes: check out the fsubscript.js code for ninjawords in the CZB pack -- the latter part seems to use javascript to filter the page before showing it in FARR. Snippet:
 js.setStrValue = function onSetStrValue(varname,value){
    if(varname == "EmbeddedWb.DocumentComplete"){
      var pl = pluginInCharge();
      if(pl == "Ninjawords_com" && loaded){
        loaded = false;
        execSafeJS(
          "document.getElementById('header').style.display='none';\n\
           document.getElementById('footer').style.display='none';\n\
           document.getElementById('footer-area').style.display='none';\n\
           document.getElementById('search-area').style.display='none';\n\
           ");
        hidePleaseWait();

edit: mouser already mentioned czb's plugins, I missed that before.
« Last Edit: August 13, 2009, 05:03 PM by Nod5 »

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: FARR html view
« Reply #4 on: August 16, 2009, 10:17 AM »
I used czb's idea from his ninjawords plugin to display weather from weather.yahoo.com. Result is attached.

Other alternative is to use Netweather from accuweather.com to get an embed script you could paste to a static html page and use that in a farr alias to display it. You just need to get the embed script from the link above, paste it to a new file, save as html, and change the path to the file in the alias.
alias i used is
1000>>>>->showfilehtml c:\some\dir\weather.html>+>^weath1$

Is there an option to make farr open links in a new browser window? Preferably in the default browser and not IE?
It is impossible to make anything foolproof because fools are so ingenious.
« Last Edit: August 16, 2009, 10:30 AM by skajfes »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR html view
« Reply #5 on: August 16, 2009, 02:49 PM »
Is there an option to make farr open links in a new browser window? Preferably in the default browser and not IE?

by default farr will open html links in your configured browser, it's only because the alias says showfilehtml that it is showing internally.

if the alias said:
1000>>>>->c:\some\dir\weather.html>+>^weath1$

then the page would be opened in your normal browser.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: FARR html view
« Reply #6 on: August 16, 2009, 03:50 PM »
by default farr will open html links in your configured browser, it's only because the alias says showfilehtml that it is showing internally.

if the alias said:
1000>>>>->c:\some\dir\weather.html>+>^weath1$

then the page would be opened in your normal browser.
I was wondering about when already in htmlview mode could you somehow tell FARR to open links in a new window. For example with using links like this:
farr://dolaunch some url
However, I tried modifying the links that way but I got an error message saying that
NOTICE: For security reasons, remote web pages are not allowed to launch farr:// links.
So, is there a way of telling FARR to open links from htmlview in a new browser window?
It is impossible to make anything foolproof because fools are so ingenious.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR html view
« Reply #7 on: August 16, 2009, 03:58 PM »
ok i think i understand.. i will add a feature to let you do that.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: FARR html view
« Reply #8 on: August 16, 2009, 05:13 PM »
With a better look at the documentation I've managed to bypass the security issue using sethtmlsafe FARR command.
There is still the issue of launching the link in a new browser window. My idea was to use dolaunch command to execute the urls but that is not working for some reason. If I use restartsearch I get the expected result - text in the farr textbox is set to the string following the restartsearch. If i use dolaunch in an alias to launch some url the default browser is opened to the url requested. But when I use dolaunch in the plugin nothing happens, FARR just closes.
It is impossible to make anything foolproof because fools are so ingenious.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR html view
« Reply #9 on: August 16, 2009, 05:21 PM »
But when I use dolaunch in the plugin nothing happens, FARR just closes.

can you give me a specific example -- that usually means farr didn't know how to launch the result.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: FARR html view
« Reply #10 on: August 16, 2009, 05:26 PM »
Sure, put this in a html file and open it in FARR's html view mode.
<a href="farr://dolaunch http://www.google.com">dolaunch</a>
<br>
<a href="farr://restartsearch http://www.google.com">restartsearch</a>
It is impossible to make anything foolproof because fools are so ingenious.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR html view
« Reply #11 on: August 16, 2009, 05:46 PM »
ok. i see.
you're right that doesnt work, and should.
until i fix you can work around it by doing:
Code: HTML [Select]
  1. <a href="farr://http://www.google.com">restartsearch</a>

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: FARR html view
« Reply #12 on: August 17, 2009, 03:36 PM »
ok. i see.
you're right that doesnt work, and should.
until i fix you can work around it by doing:
Code: HTML [Select]
  1. <a href="farr://http://www.google.com">restartsearch</a>
That works great. I've attached the upgraded plugin if somebody is interested.

Another question, though. I noticed that the plugin doesn't always give me the latest page from the web. For example IE shows the weather page as it should be, and FARR shows an outdated version. I was wondering if it has something to do with IE caching, but IE show me the latest page which confused me a bit. I should note that clearing IE cache solves the problem temporarily, but I don't know what is causing it. Any ideas?
It is impossible to make anything foolproof because fools are so ingenious.