Is there a way to integrate Goolge Gadgets into Moodle, or to display their content into Blocks ?
When a google gadget is selected, it wants a javascript to be run inside an HTML page, for e.g :
<script src="http://gmodules.com/ig/ifr?url=http://www.kodey.com/modules/google_sector_summary.xml&synd=open&w=250&h=200&title=Google+Finance+Sector+Summary&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>
Is there a way to run a script like this inside the "HTML Block" of moodle, or in any other place, like a "label" ?
Yes, I'd like to know this as well. Google has just come up with this amazing feature where you can create your own search engine and add it to a webpage. It'd be very cool if I could add this to some of my school's moodle pages.
Unfortunately, it doesn't seem to be working right now. Has anyone got it working? If not, would it be difficult to add this feature?
Thanks!
Unfortunately, it doesn't seem to be working right now. Has anyone got it working? If not, would it be difficult to add this feature?
Thanks!
Okay, I got mine working right now. I just had to click on the Toggle HTML Source button and paste the code in. Hey, I'm new!

you're right ! some of them do work !
thanks
thanks
Hello Anil,
Did you ever get an answer to your question on using xml coded gadgets?
The gadget I want is coded in xml and I too dont know if/how you can use xml im moodle, so I am stuck.
My workaround was to find an rss feed and use that http://weather.yahoo.com/forecast/CHXX0049.html
Its not exactly what I want, but would work for me until I can get more details on using xml
Hello Martin
It is possible to add google gadgets. When you find a gadget, and want to add it to your web page, it gives an option to "Get the Code" . This code is normally a line like :
<script src="http://gmodules.com/ig/ifr?url=http://1o4.jp/google/module/slim-reader.xml&up_mtitle=Slim%20RSS%20Reader&up_mfeed=http%3A%2F%2Fgoogleblog.blogspot.com%2Fatom.xml&up_contentsnum=9&up_titlelink=http%3A%2F%2Fgoogleblog.blogspot.com%2F&synd=open&w=320&h=25&title=__UP_mtitle__&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>
However, it works only it "Labels" and "HTML Block" , i haven't tried it in too many places, but it doesn't work in forum posts for sure.
Anil
It is possible to add google gadgets. When you find a gadget, and want to add it to your web page, it gives an option to "Get the Code" . This code is normally a line like :
<script src="http://gmodules.com/ig/ifr?url=http://1o4.jp/google/module/slim-reader.xml&up_mtitle=Slim%20RSS%20Reader&up_mfeed=http%3A%2F%2Fgoogleblog.blogspot.com%2Fatom.xml&up_contentsnum=9&up_titlelink=http%3A%2F%2Fgoogleblog.blogspot.com%2F&synd=open&w=320&h=25&title=__UP_mtitle__&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>
However, it works only it "Labels" and "HTML Block" , i haven't tried it in too many places, but it doesn't work in forum posts for sure.
Anil
I am trying to use Google Translate Gadget. I have set the course to allow guests so Google can enter.
I login is as Admin. When I try to use the translator it will translate the page and then send me to the login page. You are then stuck at that page.
Any ideas?
The Google code is:
<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/translatemypage.xml&up_source_Xlanguage=en&w=160&h=60&title=&border=&output=js"></script>
Hi Timothy,
Personally, I'd recommend creating a new block to display each new Google Gadget. The main reason is so that you can easily deploy the block anywhere in your Moodle installation quickly and easily, and another reason is that if you want to edit the Gadget code embedded in the block, you won't have to do it for every instance of the block, i.e. if you just copied and pasted the code into HTML blocks.
Here's a simple block I created for displaying a Google Talk Gadget:
Save this script in a directory like this:
http://***MOODLEROOT***/blocks/googletalk/block_googletalk.php
<?php
class block_googletalk extends block_base {
function init() {
$this->title = get_string('Google Talk', 'block_googletalk');
$this->version = 2008121200;
}
function specialization() {
if(!empty($this->config->title)) {
$this->title = $this->config->title;
} else {
$this->config->title = '';
}
if(empty($this->config->text)) {
$this->config->text = '';
}
}
function hide_header() {
return true;
}
function preferred_width() {
return 210;
}
function get_content() {
if($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->text = '<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/googletalk.xml&synd=open&w=200&h=400&title=&lang=en&country=US&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>';
$this->content->footer = '';
return $this->content;
}
}
?>
Actually, for something as simple as a translator, you probably don't even need to use a Google Gadget. They're just simple HTML forms anyway. I'm using Google's Dictionary like this:
Save script as: http://***MOODLEROOT***/blocks/dictionary/block_dictionary.php
The Google icon is here:
Or you can hotlink to one of their default logos... just, er, well... Google it! ;)
<?php
class block_dictionary extends block_base {
function init() {
$this->title = get_string('Dictionary', 'block_dictionary');
$this->version = 2008121600;
}
function specialization() {
if(!empty($this->config->title)) {
$this->title = $this->config->title;
} else {
$this->config->title = '';
}
if(empty($this->config->text)) {
$this->config->text = '';
}
}
function hide_header() {
return true;
}
function preferred_width() {
return 210;
}
function get_content() {
if($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->text = '<div align="center">
<form action="http://www.google.co.uk/dictionary" name="f" target="_blank">
<img src="../blocks/dictionary/Logo_25wht.gif" alt="Google" width="71" height="24" hspace="0" vspace="0" align="bottom"><strong> Dictionary</strong><br />
<input autocomplete="off" type="text" name="q" size="25" maxlength="50" value=""title="Search Dictionary">
<br />
<select id="dct-slc" name="langpair" onChange="">
<option value="en|en">Select a language...</option>
<option value="en|fr">English » French </option>
<option value="fr|en">French » English </option>
<option value="en|de">English » German </option>
<option value="de|en">German » English </option>
<option value="en|it">English » Italian </option>
<option value="it|en">Italian » English </option>
<option value="en|ko">English » Korean </option>
<option value="ko|en">Korean » English </option>
<option value="en|es">English » Spanish </option>
<option value="es|en">Spanish » English </option>
<option value="en|ru">English » Russian </option>
<option value="ru|en">Russian » English </option>
<option value="en|zh-TW">English » Chinese (Trad) </option>
<option value="zh-TW|en">Chinese (Trad) » English </option>
<option value="en|zh-CN">English » Chinese (Simp) </option>
<option value="zh-CN|en">Chinese (Simp) » English </option>
<option value="en|pt">English » Portuguese </option>
<option value="pt|en">Portuguese » English </option>
<option value="en|hi">English » Hindi </option>
<option value="hi|en">Hindi » English </option>
<option value="en|ar">English » Arabic </option>
<option value="ar|en">Arabic » English </option>
<option value="en|cs">English » Czech </option>
<option value="cs|en">Czech » English </option>
<option value="en|th">English » Thai </option>
<option value="th|en">Thai » English </option>
<option value="en|bg">English » Bulgarian </option>
<option value="bg|en">Bulgarian » English </option>
<option value="en|hr">English » Croatian </option>
<option value="hr|en">Croatian » English </option>
<option value="en|fi">English » Finnish </option>
<option value="fi|en">Finnish » English </option>
<option value="en|iw">English » Hebrew </option>
<option value="iw|en">Hebrew » English </option>
<option value="en|el">English » Greek </option>
<option value="el|en">Greek » English </option>
<option value="en|sr">English » Serbian </option>
<option value="sr|en">Serbian » English </option>
</select>
<br/>
<input type="submit" value="Search">
</form>
</div>';
$this->content->footer = '';
return $this->content;
}
}
?>
Hope this helps!
Personally, I'd recommend creating a new block to display each new Google Gadget. The main reason is so that you can easily deploy the block anywhere in your Moodle installation quickly and easily, and another reason is that if you want to edit the Gadget code embedded in the block, you won't have to do it for every instance of the block, i.e. if you just copied and pasted the code into HTML blocks.
Here's a simple block I created for displaying a Google Talk Gadget:
Save this script in a directory like this:
http://***MOODLEROOT***/blocks/googletalk/block_googletalk.php
<?php
class block_googletalk extends block_base {
function init() {
$this->title = get_string('Google Talk', 'block_googletalk');
$this->version = 2008121200;
}
function specialization() {
if(!empty($this->config->title)) {
$this->title = $this->config->title;
} else {
$this->config->title = '';
}
if(empty($this->config->text)) {
$this->config->text = '';
}
}
function hide_header() {
return true;
}
function preferred_width() {
return 210;
}
function get_content() {
if($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->text = '<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/googletalk.xml&synd=open&w=200&h=400&title=&lang=en&country=US&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>';
$this->content->footer = '';
return $this->content;
}
}
?>
Actually, for something as simple as a translator, you probably don't even need to use a Google Gadget. They're just simple HTML forms anyway. I'm using Google's Dictionary like this:
Save script as: http://***MOODLEROOT***/blocks/dictionary/block_dictionary.php
The Google icon is here:

Or you can hotlink to one of their default logos... just, er, well... Google it! ;)
<?php
class block_dictionary extends block_base {
function init() {
$this->title = get_string('Dictionary', 'block_dictionary');
$this->version = 2008121600;
}
function specialization() {
if(!empty($this->config->title)) {
$this->title = $this->config->title;
} else {
$this->config->title = '';
}
if(empty($this->config->text)) {
$this->config->text = '';
}
}
function hide_header() {
return true;
}
function preferred_width() {
return 210;
}
function get_content() {
if($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->text = '<div align="center">
<form action="http://www.google.co.uk/dictionary" name="f" target="_blank">
<img src="../blocks/dictionary/Logo_25wht.gif" alt="Google" width="71" height="24" hspace="0" vspace="0" align="bottom"><strong> Dictionary</strong><br />
<input autocomplete="off" type="text" name="q" size="25" maxlength="50" value=""title="Search Dictionary">
<br />
<select id="dct-slc" name="langpair" onChange="">
<option value="en|en">Select a language...</option>
<option value="en|fr">English » French </option>
<option value="fr|en">French » English </option>
<option value="en|de">English » German </option>
<option value="de|en">German » English </option>
<option value="en|it">English » Italian </option>
<option value="it|en">Italian » English </option>
<option value="en|ko">English » Korean </option>
<option value="ko|en">Korean » English </option>
<option value="en|es">English » Spanish </option>
<option value="es|en">Spanish » English </option>
<option value="en|ru">English » Russian </option>
<option value="ru|en">Russian » English </option>
<option value="en|zh-TW">English » Chinese (Trad) </option>
<option value="zh-TW|en">Chinese (Trad) » English </option>
<option value="en|zh-CN">English » Chinese (Simp) </option>
<option value="zh-CN|en">Chinese (Simp) » English </option>
<option value="en|pt">English » Portuguese </option>
<option value="pt|en">Portuguese » English </option>
<option value="en|hi">English » Hindi </option>
<option value="hi|en">Hindi » English </option>
<option value="en|ar">English » Arabic </option>
<option value="ar|en">Arabic » English </option>
<option value="en|cs">English » Czech </option>
<option value="cs|en">Czech » English </option>
<option value="en|th">English » Thai </option>
<option value="th|en">Thai » English </option>
<option value="en|bg">English » Bulgarian </option>
<option value="bg|en">Bulgarian » English </option>
<option value="en|hr">English » Croatian </option>
<option value="hr|en">Croatian » English </option>
<option value="en|fi">English » Finnish </option>
<option value="fi|en">Finnish » English </option>
<option value="en|iw">English » Hebrew </option>
<option value="iw|en">Hebrew » English </option>
<option value="en|el">English » Greek </option>
<option value="el|en">Greek » English </option>
<option value="en|sr">English » Serbian </option>
<option value="sr|en">Serbian » English </option>
</select>
<br/>
<input type="submit" value="Search">
</form>
</div>';
$this->content->footer = '';
return $this->content;
}
}
?>
Hope this helps!
THANKS!
Tim
Tim