greasemonkey
DESCRIPTION
Greasemonkey. Angela Kille 20 March 2006 INF385T Semantic Web. Overview. What is Greasemonkey? User scripts Examples Semantic web connection Related tools. What is Greasemonkey?. Firefox extension Download from: greasemonkey.mozdev.org - PowerPoint PPT PresentationTRANSCRIPT
Greasemonkey
Angela Kille20 March 2006INF385T Semantic Web
Overview
• What is Greasemonkey?
• User scripts
• Examples
• Semantic web connection
• Related tools
What is Greasemonkey?
• Firefox extensiono Download from: greasemonkey.mozdev.org
• Change the behavior of web pages by installing user scripts
o Download o Write your owno Alter existing scripts
User Scripts
• Single file written in JavaScript
• Filename must end in: .user.js
• Customizes one or more web pages
• Can do anything JavaScript can do – and more because Greasemonkey provides special API functions
User Scripts: Install
• User scriptso userscripts.org – repository of user scriptso Greasemonkey Hacks by Mark Pilgrim (2006)
• Installo Tools | Install this user script…
• Code new user script o Tools | New user script…
User Scripts: Manage
• Firefox Tools menu | Manage user scripts…o See list of installed user scripts
o Change configurations (included/excluded pages)
o Disable scripts temporarily
o Uninstall scripts
o Edit user scripts “live” (Tools | Manage user scripts… | select script, then click Edit)
User Scripts: Metadata
Hello World User Script
// ==UserScript==// @name Hello World// @namespace http://diveintogreasemonkey.org/download/// @description example script to alert "Hello world!" on every page// @include *// @exclude http://diveintogreasemonkey.org/*// @exclude http://www.diveintogreasemonkey.org/*// ==/UserScript==
alert('Hello world!');
User Scripts: Metadata (directives)
// @include *
// @exclude http://diveintogreasemonkey.org/*
// @exclude http://www.diveintogreasemonkey.org/*
// @exclude http://*.google.com/*
// @exclude http://www.amazon.tld/*
• Wildcards
Examples: Links
• Linkifier user scripto Turns plain text URLs and email addresses
into clickable links
• See it in action at:o http://www.mnot.net/blog/2005/05/18/WADL
Examples: Forms
• Textarea Resize user scripto Make textareas larger by pressing Ctrl-Enter
or Ctrl-Spacebar in a textareao Textareas can be shrunk by pressing Shift-
Ctrl-Enter and Shift-Ctrl-Spacebar
• Test at:o http://www.htmlcodetutorial.com/forms/_TEXTAREA.html
Examples: Search
• Search Onsite user script– Search current website’s content with Google– Results displayed floating on the page you
are currently viewing
• Test at:– http://www.ischool.utexas.edu/
Examples: Libraries
• Amazon SPL Linky user scripto Search the Seattle Public Library catalog from
Amazon book listings
• Google Books AADL Linky user scripto Search the Ann Arbor District Library holdings
from Google Books
Examples: Magic Line
• Magic Line user script– Collects all the metadata it can find as you
browse the web: • URL, page title, people’s names, article
descriptions, tags & keywords, referrer URLs, RSS & Atom feeds, FOAF files
Semantic Web
• Site integration with Greasemonkey API function – Allows user scripts to get and post data to any
site at any time
• APIs – Amazon, Google, etc.
Related Tools
• Platypus extension for Firefoxo http://platypus.mozdev.org/o Modify a web page from your browser (WYSIWYG)
and save those changes as a Greasemonkey script
• Greasemonkey compilero http://www.letitblog.com/greasemonkey-compiler/ o Form that converts Greasemonkey user scripts into
Firefox extensions (XPI file)
ReferencesBrooks, T. A. (2005, July). Watch this: Greasemonkey the Web. Information Research,
10(4). Retrieved March 14, 2005, from http://informationr.net/ir/10-4/TB0507.html Filman, R.E. (2006, Jan.-Feb.). Taking back the Web. IEEE Internet Computing, 10(1), 3-5.
Retrieved March 14, 2005, from IEEE.Pilgrim, M. (2005, Nov. 11). Avoid common pitfalls in greasemonkey: How the history of
greasemonkey security affects you now. Retrieved March 14, 2005, from O'Reilly Network Web site: http://www.oreillynet.com/pub/a/network/2005/11/01/avoid-common-greasemonkey-pitfalls.html
Pilgrim, M. (2005). Dive into greasemonkey. Retrieved March 14, 2005, from http://diveintogreasemonkey.org/
Pilgrim, M. (2006). Greasemonkey hacks: Tips & tools for remixing the Web with Firefox. Sebastopol, CA: O'Reilly.
Pilgrim, M. (2005, Sept. 1). What is greasemonkey. Retrieved March 14, 2005, from O'Reilly Network Web site: http://www.oreillynet.com/pub/a/network/2005/09/01/what-is-greasemonkey.html
Other Resources:mozdev.org - greasemonkey … http://greasemonkey.mozdev.org/
download greasemonkey for Firefoxuserscripts.org … http://userscripts.org/
repository for greasemonkey user scripts
Questions?