Difference between revisions of "TiddlyWikiGoogleTagCombinations"

(set bilink marker)
(BiLinks)
Line 377: Line 377:
 
* [[User_talk:VartanSimonian]]
 
* [[User_talk:VartanSimonian]]
 
* [[OpenWiki:TiddlyWikiGoogleTagCombinationsForOpenWiki]]
 
* [[OpenWiki:TiddlyWikiGoogleTagCombinationsForOpenWiki]]
 +
* [[http://groups.google.com/group/TiddlyWiki/browse_thread/thread/bcd7a9510210f76a]]

Revision as of 09:46, 19 July 2008

Intro

From TiddlyWiki

GoogleTagCombinations allow to setup complex queries for social exploring and filtering in a wiki-context. It's an idea of FridemarPache, first published in Meatball:GoogleTagWiki and has a code-prototype, realized by VartanSimonian. See also User_talk:VartanSimonian

As it is written in Java-Script, it should be integrated into TiddlyWiki, which is also based on Java-Script.

Since both sources are OpenSource, anybody who has time and some experience with TiddlyWiki, is invited to make it a plugin of TiddlyWiki.

This increases the value of TiddlyWiki for social collaboration, not only in SharedEcommerce which is a new initiative within the wider framework of ExtremeOpenBusiness:

The code-prototype

// JavaScript Document
//<script type="text/javascript">

//<!--
/* Linklist variable contains list of selected links */
var linklist = '';
/* SearchPrefix - search URL (customizable search engine) before Search Query */
var SearchPrefix='http://www.google.com/search?q='

/* SearchSuffix - search URL (customizable search engine) after Search Query */
var SearchSuffix='&hl=en';

/* FP_getObjectByID - cross-browser get object by id (made by expression web aka frontpage) */
function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n;

 if(!o)o=document;

 if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers;
 else if(o.all) el=o.all[id];

 if(el) return el;

 if(o.id==id || o.name==id) return o;
 if(o.childNodes) c=o.childNodes;

 if(c)
   for(n=0; n<c.length; n++) {
    el=FP_getObjectByID(id,c[n]);
    if(el) return el;
   }

 f=o.forms;

 if(f)
   for(n=0; n<f.length; n++) {
   els=f[n].elements;

   for(m=0; m<els.length; m++){
    el=FP_getObjectByID(id,els[n]);
    if(el) return el;
   }
 }

 return null;
}

/* doCheck - will toggle between whether link is selected for searching or not
 * sender - check box triggering this function
 * link - link text
 */
function doCheck(sender, link) {
	if (linklist.match(escape(link)) == null) { //if link has been selected already //.. fp
		linklist += ',' + escape(link); //add link to link list
		sender.checked = true; /*make sure that checkbox is checked, in case the user
returned to the page via the browser's back button, but the browser remembered only the checkbox value */
	} else { //if the link has been selected
//		linklist = linklist.replace(new RegExp("," + escape(link), "gi"), ""); /*
		linklist = linklist.replace("," + escape(link), ""); /* .. fp: do we really need Regs and case-insensitivity
remove link from link list*/
		sender.checked = false; /*make sure that checkbox is unchecked, in case the user
returned to the page via the browser's back button, but the browser remembered only the checkbox value */
	}
}

function goSearch() {
// launches the Search with the TagCombination as Search Term

	var links = linklist.split(',');  // creates an array of the checked links based on linklist

  var searchUrl = SearchPrefix; // the Google search term ..

  for (var x in links) { // .. successively filled with the checked links
		searchUrl += links[x] + '+'; // the last superfluous plus-sign doesn't do any harm
	}
	location.href = searchUrl + SearchSuffix; // start the combined Google search
}

var quoteChar="\"";

function quote(s) {
return quoteChar+s+quoteChar;
}

var ahref="<a href=\"";
var searcher="test";
var GoogleIcon="http://images.aboutus.org/images/1/18/GoogleIcon.png";
var QuotedGoogleIcon=quote(GoogleIcon);

function g(s,t) { // GoogleDoubleLinkWithOptionbox
//document.writeln("<a href="+ quote(SearchPrefix + quote(s))+ "> ");
//document.writeln("<img src=" + quote(GoogleIcon) + " alt="+quote("(Google)") + " style="+quote("border-style: none;") +" /></a>");
  document.write("<input type=\"checkbox\" onclick=\"doCheck(this,"  + "\'"+s + "\'" + ");\""  + " />");
  document.write(" <a href=\"http://AboutUs.org/" +  s  + "\"" + ">" + s + "</a>");
//  document.write("<XMP>")
  document.write(" " + t +" ");
//  document.write("</XMP>")

};


// -->
//</script>

An application example

You can see, test and download the following application example in real life at Meatball:GoogleTagWiki.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Link text</title>
<script src="GoogleTag.js"></script>
</head>

<body>
<a name="top"></a>
<button onClick="goSearch();">Click here to search for a GoogleTagCombination!</button>
<p />

<script>
/*g("WikiTag");
g("TagCombination");
g("GoogleTag");
g("GoogleTagCombination");
g("TagWiki");
g("GoogleTagWiki");
g("AboutUs");
g("Vartan");
g("TedErnst");
g("fridemar");

gap(3);
*/

g("WikiTag","is the WikiWord replacement, allowing combined searches. Several WikiTags form a");
g("TagCombination","i.e. one or more checked OptionBoxes form a TagCombination. A");
g("GoogleTag","A CamelCase search term, that can be combined with other such terms.");
g("GoogleTagCombination","is a TagCombination for Google searches");
g("TagWiki","is a Wiki, where WikiTags replace WikiWords");
g("GoogleTagWiki","A wiki, whose WikiWords are GoogleTags.");
g("AboutUs","A giant wiki, for open collaboration.");
g("Vartan","is the young script programmer of this prototype in AboutUs.Org .");
g("TedErnst","motivated Vartan, to make the prototype.");
g("fridemar","initiated the idea and is a bit messing around with Vartan's code. ;-)");
</script>


</body>

</html>

Dialog with TiddlyWiki Developers

First Round

On [[1]] (GoogleGroup:TiddlyWikiDev:GoogleTagCombinations) Fridemar asked:

Dear developers,
who is interested to integrate the JavaScript of Vartan into
TiddlyWiki.
See  http://aboutus.org/TiddlyWikiGoogleTagCombinations for
details.

and Tobias Beer answered there (and hopefully here for deepening the dialogue, using the infra-structure of Aboutus):

Subject: Re: GoogleTagCombinations as extension wanted.
Is that intended to replace internal wiki link's with external ones?
If so, I don't find the idea very propelling, besides I don't think
googles indexes get updated this often, or do I misunderstand the
concept? Wouldn't you rather want to do things like that with a
"simple" firefox plugin like "hyperwords"? Why would you want that in
the wiki site itself? Isn't that a bit too much googlifying the whole
web?

Thank you Tobias for giving me and other interested peers the opportunity to elaborate a bit on this:

You understand me right, that there is even more potential in it, than "only" replacing the internal wiki links by it. In TiddlyWiki, I suggest, to extend the parser a bit, to allow embedded GoogleTagCombinations, as e.g.

$GoogleSearchTerm1,Comment1 ....some text ... $GoogleSearchTerm2,Comment2 .. etc,

for calling the above defined (and to be improved) function g that call g("GoogleSearchTerm1",Comment1) ....some text ... g("GoogleSearchTerm2",Comment2) ....etc.

These interspersed calls produce (in the TiddlyWiki view-mode) option boxes, that can be (un-)checked by the users and used as a Google query by clicking an additional command-link, that is added to the line, where you have already: "edit","done", ... : This way the new command line shows up as: "edit","done","search", ... For convenience, "search" should only be shown, if there is at least one GoogleSearchTerm defined.

Another good idea, you imply, is: that we should have a "dual use" for the GoogleTagCombinations, similar to the following example, that is handled in the Aboutus wiki: G TiddlyWiki.

With one marker you get at the same time, two links: one pointing to Google and the other one, to an internal wiki link. Now think this latter template tool generalized to arbitrary (Google-) Tag Combinations and you see the power of this construct and how useful it is for (collective) filtering (in communities).

Please have a look at [[2]] where interested developers and plug-in programmers can deepen the dialogue on this special topic.

Second Round

In the spirit of wiki, the concept author suggests the following simplification:

Each link gets automatically an additional external GoogleTag with option box, unless this dual use feature is unchecked.

e.g. instead of TiddlyWiki, we get [ ]G TiddlyWiki, the "dual use" mode for each link. But you must imagine, that the Google Icon is replaced by a sole googlish option box.

To do this, it is suggested to use the commandlinks (currently placed over each "Tiddler"):

"edit","done", "[x] search", ...

"edit","done", "[ ] search", ...

as follows.

"[ ] search" means: only all usual internal links are shown and "search" is greyed out:

"[x] search" means: all usual internal links are shown and additionally all Google option tags. Besides that, "search" is clickable and onclick produces a complex Google search as defined by the checked TagCombination.

fridemar 12:42, 17 July 2008 (PDT)

Third Round

From [[3]]

Tobias Beer:
I am still on the page of right clicking some selected text and doing
a "search with... (maybe google or could it not be wikipedia as
well?)".
Is google indexing these links (in a specific way) once it actually
find them? If so, is there a specific google-tag-link-format to adhere
to? What are those "comments" you want to pass on to the g function?
Are those "simply" tooltips for the links to be created?
I can see the idea of the search button in the tiddler toolbar which
would probably open a popup listing the "google-tag-links" found in
the tiddler content. But again, why all this internal wiki-indexing?
Unless google actually indexes those links semantically, I don't quite
see the point, besides a certain google-friendlyness/-affiliation.

The following is a structurally enhanced dialogue of Tobias's newsgroup posting in [[4]] . Fridemar did the editorial work for the convenience of the readers and additional writers to plug in.

To Google or not to Google

Tobias: I am still on the page of right clicking some selected text and doing a "search with... (maybe google or could it not be wikipedia as well?)".

Fridemar:

Naturally we could customize the involved search-range and search engines. As Google is more universal, it appears to be more appropriate to connect different wikis (especially if they adhere to the CamelCase notation, which now become GoogleTags). You could object, that Google brings too much hits to be useful.

Hey, that depends. Please have a look at the long WikiTags at Meatball:GoogleTagWiki. Although this page exists over a year, the short lists of Google search hits, prove that different wikis could very well be mediated/connected via Google in addition to their internal connectivity. fridemar 14:20, 17 July 2008 (PDT)


GoogleTagLinkFormat

Tobias:

Is google indexing these links (in a specific way) once it actually find them? If so, is there a specific google-tag-link-format to adhere to?

Fridemar: If you take as suggested the original CamelCase, compare the following two Google queries, for which I guess, that we will see CamelCase selecting sharper then a combined search:

fridemar 14:20, 17 July 2008 (PDT)

Tooltips over Tags

Tobias:

What are those "comments" you want to pass on to the g function? Are those "simply" tooltips for the links to be created?

Fridemar: This is a good idea of you. Originally I made those comments as a test context, because I didn't integrate the construct in a WikiEngine.

We may omit this feature for the moment, because the "Tiddlers" can give this context. So the function g needs only one parameter. fridemar 14:20, 17 July 2008 (PDT)

TagsAsPopUpLists

Tobias: I can see the idea of the search button in the tiddler toolbar which would probably open a popup listing the "google-tag-links" found in the tiddler content.


Fridemar: This is another good idea, that makes the construct even more user-friendly. Originally I thought of screensized Twiddlers, where the tags can be checked without scrolling. fridemar 14:20, 17 July 2008 (PDT)

InternalWikiIndexing

Tobias: But again, why all this internal wiki-indexing?

Fridemar: I don't quite understand what you mean by this, since my focus is just on ExternalWikiIndexing. fridemar 14:20, 17 July 2008 (PDT)

ExternalWikiIndexing

Tobias: Unless google actually indexes those links semantically, I don't quite see the point, besides a certain google-friendlyness/-affiliation.

Fridemar: If wikizens use their WikiTags in a considerate way, they create SpindleCellsInTheGlobalBrain, enabling Meatball:IncidentalCollaboration. As soon as we have Meatball:GoogleTagCombinations I guess, we see an new ere of InterWikiCollaboration. fridemar 14:20, 17 July 2008 (PDT)

fridemar 05:04, 16 July 2008 (PDT)

GooglishTiddlyWiki

Preparing a page with a shorter Name for factoring out:

GooglishTiddlyWiki fridemar 17:57, 18 July 2008 (PDT)

BiLinks



Retrieved from "http://aboutus.com/index.php?title=TiddlyWikiGoogleTagCombinations&oldid=16013808"