1 / 17

Greasemonkey

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

hogan
Download Presentation

Greasemonkey

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Greasemonkey Angela Kille 20 March 2006 INF385T Semantic Web

  2. Overview • What is Greasemonkey? • User scripts • Examples • Semantic web connection • Related tools

  3. What is Greasemonkey? • Firefox extension • Download from: greasemonkey.mozdev.org • Change the behavior of web pages by installing user scripts • Download • Write your own • Alter existing scripts

  4. 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

  5. User Scripts: Install • User scripts • userscripts.org – repository of user scripts • Greasemonkey Hacks by Mark Pilgrim (2006) • Install • Tools | Install this user script… • Code new user script • Tools | New user script…

  6. User Scripts: Manage • Firefox Tools menu | Manage user scripts… • See list of installed user scripts • Change configurations (included/excluded pages) • Disable scripts temporarily • Uninstall scripts • Edit user scripts “live” (Tools | Manage user scripts… | select script, then click Edit)

  7. 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!');

  8. User Scripts: Metadata (directives) // @include * // @exclude http://diveintogreasemonkey.org/* // @exclude http://www.diveintogreasemonkey.org/* // @exclude http://*.google.com/* // @exclude http://www.amazon.tld/* • Wildcards

  9. Examples: Links • Linkifier user script • Turns plain text URLs and email addresses into clickable links • See it in action at: • http://www.mnot.net/blog/2005/05/18/WADL

  10. Examples: Forms • Textarea Resize user script • Make textareas larger by pressing Ctrl-Enter or Ctrl-Spacebar in a textarea • Textareas can be shrunk by pressing Shift-Ctrl-Enter and Shift-Ctrl-Spacebar • Test at: • http://www.htmlcodetutorial.com/forms/_TEXTAREA.html

  11. 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/

  12. Examples: Libraries • Amazon SPL Linky user script • Search the Seattle Public Library catalog from Amazon book listings • Google Books AADL Linky user script • Search the Ann Arbor District Library holdings from Google Books

  13. 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

  14. 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.

  15. Related Tools • Platypus extension for Firefox • http://platypus.mozdev.org/ • Modify a web page from your browser (WYSIWYG) and save those changes as a Greasemonkey script • Greasemonkey compiler • http://www.letitblog.com/greasemonkey-compiler/ • Form that converts Greasemonkey user scripts into Firefox extensions (XPI file)

  16. References Brooks, 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 Firefox userscripts.org … http://userscripts.org/ repository for greasemonkey user scripts

  17. Questions?

More Related