DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:scrape

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
plugin:scrape [2014-07-05 09:44] – created andiplugin:scrape [2023-09-20 14:56] (current) – old revision restored (2023-09-14 23:51) Aleksandr
Line 4: Line 4:
 description: Include HTML parts from other website into the wiki description: Include HTML parts from other website into the wiki
 author     : Andreas Gohr  author     : Andreas Gohr 
-email      : andi@splitbrain.org +email      : dokuwiki@cosmocode.de
 type       : syntax type       : syntax
-lastupdate : 2011-06-28+lastupdate : 2023-09-14
 compatible :  compatible : 
 depends    :  depends    : 
Line 13: Line 13:
 tags       : include, html, jquery tags       : include, html, jquery
  
-downloadurl: http://github.com/cosmocode/dokuwiki-plugin-scrape/zipball/master +downloadurl: https://github.com/cosmocode/dokuwiki-plugin-scrape/zipball/master 
-bugtracker : http://github.com/cosmocode/dokuwiki-plugin-scrape/issues +bugtracker : https://github.com/cosmocode/dokuwiki-plugin-scrape/issues 
-sourcerepo : http://github.com/cosmocode/dokuwiki-plugin-scrape/+sourcerepo : https://github.com/cosmocode/dokuwiki-plugin-scrape/
 donationurl:  donationurl: 
  
Line 22: Line 22:
  
 This plugin allows you to include HTML scraped from a different website. The part to include can be specified by a jQuery-like expression. To prevent abuse all HTML is purified against malicious code and only whitelisted URLs can be scraped. This plugin allows you to include HTML scraped from a different website. The part to include can be specified by a jQuery-like expression. To prevent abuse all HTML is purified against malicious code and only whitelisted URLs can be scraped.
- 
  
 ===== Installation ===== ===== Installation =====
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+[[https://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ http://cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]] 
 + 
 +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Configuration ===== ===== Configuration =====
Line 34: Line 35:
 ===== Syntax/Usage ===== ===== Syntax/Usage =====
  
-The general syntax is: ''%%{{scrape>%%//url// //query//|//title//%%}}%%''.+The general syntax is:
  
-''//url//'' is the URL of the website you want to scrape. It must be matched by the regular expression given in the config.+  {{scrape>url query|title}}
  
-''//query//'' is the jQuery like query to select page element on the given website. See the [[http://code.google.com/p/phpquery/wiki/jQueryPortingState|phpQuery manual]] for the available selectors. When you end your query with a ''~'' the innerHTML of the match will be used, otherwise the matched wrapping element itself will be part of the output. When no query is given, ''body ~'' is used.+  * **url** is the URL of the website you want to scrape. It must be matched by the regular expression given in the config. 
 +  * **query** is the ''querySelectorAll()''-like CSS selector to select one or more page elements on the given website. When you end your query with a ''~'' the innerHTML of the match will be used, otherwise the matched wrapping element itself will be part of the output. When no query is given, ''body ~'' is used
 +  * **title** is only used when your query matched the URL of an image file. In that case the image will be embedded and the given title be added. You can leave out the title.
  
-''//title//'' is only used when your query matched the URL of an image file. In that case the image will be embedded and the given title be added. You can leave out the title.+Example:
  
-FIXME examples should be added+  {{scrape>https://example.com p}}
plugin/scrape.1404546289.txt.gz · Last modified: 2014-07-05 09:44 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki