SAYNOTO0870.COM
https://www.saynoto0870.com/cgi-bin/forum/YaBB.cgi
Main Forum >> Site Related >> suggestion: Create Firefox extension
https://www.saynoto0870.com/cgi-bin/forum/YaBB.cgi?num=1148633980

Message started by sbutton on May 26th, 2006 at 8:59am

Title: suggestion: Create Firefox extension
Post by sbutton on May 26th, 2006 at 8:59am
It would be really useful if you could just right click on a phone number (after highlighting it), and then pick "Look up saynoto0870..." and it goes off and finds the number you need.

There are similar Firefox extentions for "Look up definition of.." which goes off to an on-line dictionary, or "Search web for...." which goes off to your chosen search engine.

Another useful one is "Stumbleupon...", which really rocks.

Perhaps this is not the best place to suggest this, and I should be posting this in the Firefox forums.

Any thoughts on this?

Steve

Title: Re: suggestion: Create Firefox extention.
Post by sbutton on Jun 2nd, 2006 at 9:07am
I guess no then?

Steve

Title: Re: suggestion: Create Firefox extention.
Post by Heinz on Jun 2nd, 2006 at 10:16am
As a user of Firefox, I'd support such a thing - but haven't a clue how it would be done.

Do you have the knowledge?

There is a problem though in that the Unverified Lists are now very large (possibly even larger than the Verified List) and, AFAIK, the 'Search for a number' facility only searches the Verified Lists.

It would therefore be easy to assume you'd searched but you wouldn't have searched fully.

Title: Re: suggestion: Create Firefox extention.
Post by sbutton on Jun 2nd, 2006 at 10:38am
I'm not exactly sure how it would be done, but I have done a bit of programming in the past (like 5 years worth) so I should be able to figure it out... if 1) There is a demand ... 2) I can find the time. ... 3) There is not already something similar which can be "tweaked" to do the same thing (no point re-inventing the wheel)

I've posted a question http://forums.mozillazine.org/viewtopic.php?p=2292047#2292047 onto the mozillazine forums, and there is a discussion going on there about the TermBlaster extension to Firefox... but there is a problem. It seems that "right click" doesn't work on the saynoto0870 form. Perhaps someone here could shed some light as to why this might be??

Thanks,

Steve

Title: Re: suggestion: Create Firefox extention.
Post by mmmmmm on Aug 19th, 2006 at 1:00pm
I have adapted a common "linkify" script to convert 0870 numbers on websites into links. It works most of the time, but not always (for some reason or another). The unverified list is not checked.

Installation instructions:

1. Install the Greasemonkey Firefox extension http://greasemonkey.mozdev.org/

2. Copy and paste the following code into a file called 0870.user.js


Code (]// 0870 Linkify
// Inspired by: UPS Tracking Linkify (http://plutor.org/files/upslinkify.user.js) by Logan Ingalls
// and SunRocket VoIP Dial Linkify.
//
//
// ==UserScript==
// @name           0870 Linkify
// @namespace      http://www.saynoto0870.com/
// @description    Looks for phone numbers in the page and hyperlinks them to saynoto0870.com search.
// @include        *
// ==/UserScript==

(function () {
       const trackRegex = /\b(0871|0870|0845|0844)([ \t\r\n):

?\d){7}\b/ig;

     function trackUrl(t) {
           return "http://www.saynoto0870.com/numbersearch.php?number=" + String(t).replace(/\) /g, "-");
     }

   // tags we will scan looking for 0870 numbers
   var allowedParents = [
       "abbr", "acronym", "address", "applet", "b", "bdo", "big", "blockquote", "body",
       "caption", "center", "cite", "code", "dd", "del", "div", "DIV", "dfn", "dt", "em",
       "fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", "i", "iframe",
       "ins", "kdb", "li", "object", "pre", "p", "q", "samp", "small", "span", "strike",
       "s", "strong", "sub", "sup", "td", "table", "tr", "th", "tt", "u", "var"
       ];
   
   var xpath = "//text()[(parent::" + allowedParents.join(" or parent::") + ")" + "]";

   var candidates = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

   for (var cand = null, i = 0; (cand = candidates.snapshotItem(i)); i++) {
       if (trackRegex.test(cand.nodeValue)) {
           var span = document.createElement("span");
           var source = cand.nodeValue;
           
           cand.parentNode.replaceChild(span, cand);

           trackRegex.lastIndex = 0;
           for (var match = null, lastLastIndex = 0; (match = trackRegex.exec(source)); ) {
               span.appendChild(document.createTextNode(source.substring(lastLastIndex, match.index)));
               
               var a = document.createElement("a");
               a.setAttribute("href", trackUrl(match[0]));
               a.appendChild(document.createTextNode(match[0]));
               span.appendChild(a);

               lastLastIndex = trackRegex.lastIndex;
           }

           span.appendChild(document.createTextNode(source.substring(lastLastIndex)));
           span.normalize();
       }
   }

})();


3. Copy and paste the following code into a file called 0870.html - save it into the same directory as 0870.user.js:
[code]<a href="0870.user.js">Right click to install script</a>[/code]

4. Open the html file in Firefox. Right click the link, then click "Install This User Script". A message should appear stating that installation was successful.

5. Test the functionality by visiting a website. Example: http://www.telephonesonline.co.uk/helpline.asp (a site chosen at random). The 0870 numbers should now be links that link to this site.

This script works for me, but I can't guarantee that it'll work for you. Hope this helps!

Title: Re: suggestion: Create Firefox extention.
Post by msuxg on Sep 13th, 2006 at 12:57pm
Sorry, I've come in late to this discussion, but a while ago I created a search engine pluging for Firefox users of this site.

It is available (along with one created by another author) to download from http://mycroft.mozdev.org/download.html?name=saynoto0870&sherlock=yes&opensearch=&submitform=Search

Title: Re: suggestion: Create Firefox extension
Post by john s on Sep 25th, 2006 at 12:04am
I use the "Advanced URL Builder" extension:

https://addons.mozilla.org/firefox/1399/

This lets you build a menu of various search engines and is easy to add your own (once you've worked out what you need to enter - and yes, that is me who left the feedback).

In this site's case, all you need to enter is:

http://www.saynoto0870.com/numbersearch.php?number=

Then select the number you're looking for, right click, and go from there. Note this only works for numbers. You'd need to adapt the above to search for company names.

This is my first post. Just want to say this is a great site and it's certainly proved useful to me recently. Good luck with the campaign!

SAYNOTO0870.COM » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2024. All Rights Reserved.