plugin:sqlraw
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:sqlraw [2013-10-25 02:24] – tom_c | plugin:sqlraw [2018-06-05 23:59] (current) – [Installation] Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
---- plugin ---- | ---- plugin ---- | ||
Line 6: | Line 6: | ||
email : tcafferty@glocalfocal.com | email : tcafferty@glocalfocal.com | ||
type : syntax | type : syntax | ||
- | lastupdate : 2013-09-03 | + | lastupdate : 2013-11-17 |
- | compatible : Weatherwax | + | compatible : Adora Belle, |
depends | depends | ||
conflicts | conflicts | ||
Line 27: | Line 27: | ||
* Select, and | * Select, and | ||
* Insert. | * Insert. | ||
- | I recommend creating a user account and granting database specific privilege to that account, | + | I recommend creating a user account and granting database specific privilege to that account, |
- | :!: **External requirements: | + | Search and install |
- | + | ||
- | Install | + | |
Update the configuration data for the user account login information for the database. | Update the configuration data for the user account login information for the database. | ||
+ | |||
+ | :!: **External requirements: | ||
+ | - [[http:// | ||
+ | - If the table sort capability is wanted | ||
+ | * sorttable.min | ||
+ | * action.php | ||
===== Examples/ | ===== Examples/ | ||
- | The following is data from a scrape of a US Employment data table. (Note that column headings have no spaces when a new line is started. Otherwise use an underscore for spaces. Eg: July2013). | + | Examples can be seen at < |
- | | + | |
- | The following is data from a csv file provided | + | < |
- | | + | |
- | The following is an example using a dokuwiki page with a table | + | Create a dokuwiki page called runexample with the following content. This example created a page at users: |
- | + | ||
- | | + | |
< | < | ||
Line 70: | Line 72: | ||
</ | </ | ||
- | - Create another dokuwiki page with the following content. This uses the tableplot | + | Create another dokuwiki page with the following content. This uses the sqlraw |
+ | < | ||
+ | <sqlraw | ||
- | < | + | </code> |
This page processes a scrape of the supplied link to my_run_log page to get the first table present following a marker. The data is put into a temporary database table. Then a query is run on the temporary table to select only date and calculate the speed in minutes per mile. The query produces an output table which is replaced by a plot of the data. | This page processes a scrape of the supplied link to my_run_log page to get the first table present following a marker. The data is put into a temporary database table. Then a query is run on the temporary table to select only date and calculate the speed in minutes per mile. The query produces an output table which is replaced by a plot of the data. | ||
- | <sqlraw id='myrun' title=' | + | * The following is an example using the sort capability for the created table |
- | + | < | |
- | <tableplot>& | + | |
- | </ | + | {{keywords> |
+ | </code> | ||
+ | Set the class as 'sortable" | ||
+ | * The following example gets the data from an online csv file. The source option is now set to csvfile. The url link points to a downloadable csv file. | ||
+ | < | ||
+ | <sqlraw id=" | ||
</ | </ | ||
===== Syntax ===== | ===== Syntax ===== | ||
Line 86: | Line 95: | ||
< | < | ||
- | * id = ' | + | ^ Parameter ^ Values ^ Description ^ |
- | | + | | |
- | | + | | |
- | | + | | |
- | | + | | |
- | * tableid = ' | + | | |
- | | + | | |
- | | + | | |
- | | + | | |
+ | | caption | ||
+ | | tableNumber | ||
+ | | fixTable | ||
===== Configuration and Settings ===== | ===== Configuration and Settings ===== | ||
Line 100: | Line 112: | ||
Configuration item | Configuration item | ||
- | **'tempdb'** | + | **'sqlraw_tempdb'** |
is used to set the temporary database login. It is in the format of | is used to set the temporary database login. It is in the format of | ||
Line 106: | Line 118: | ||
' | ' | ||
| | ||
- | **'debugfilepath' | + | **'sqlraw_debugfilepath' |
- | provides a file path and filename to save the raw data for scraped tables. The table data will be saved as a csv file. This is useful for debugging the table output from a scraped table. An empty or null string will specify do not write the csv file. Note that this is only for table data. The path is relative to the dokuwiki base install folder. | + | provides a file path and filename to save the raw data for scraped tables. The table data will be saved as a csv file. This is useful for debugging the table output from a scraped table. An empty or null string will specify do not write the csv file. Note that this is only for table data. The path is relative to the dokuwiki base install folder. If not needed for debug then set to a empty string to execute faster. |
- | **'restrict_names'** | + | **'sqlraw_restrict_names'** |
If true (=1) then scraped table headings will be searched for all elements in the configuration array of ' | If true (=1) then scraped table headings will be searched for all elements in the configuration array of ' | ||
- | **'mysqlDisallow'** | + | **'sqlraw_mysqlDisallow'** |
array of elements to replace if restrict_names is true (1) | array of elements to replace if restrict_names is true (1) | ||
- | **'mysqlReplace'** | + | **'sqlraw_mysqlReplace'** |
array of replacement elements for disallowed header elements. | array of replacement elements for disallowed header elements. | ||
+ | ===== Development ===== | ||
+ | The plugin will run considerably faster on scraping website tables if the following debug capabilities are not used. . They are turned off with the following settings. | ||
- | + | in the conf/ | |
- | + | | |
- | ===== Development ===== | + | |
- | + | On an individual page, the following default parameter. | |
- | // | + | fixTable = ' |
=== Change Log === | === Change Log === |
plugin/sqlraw.1382660677.txt.gz · Last modified: 2013-10-25 02:24 by tom_c