This menu allows you to manage MyNews templates.
Templates list
The main page of this menu displays the list of all templates present in your MyNews server. The list have four columns:
Template editor
A template describes a website and how to grab news from this site. The template editor is composed of six different parts:
General: general information about the website.
- Id: template id (alphanumeric chars only, unique, ie:
slashdot )
- Name: website name (for display purpose, ie:
Slashdot )
- Comment: website comment (for display purpose, ie:
News for nerds, stuff that matters )
- URL: URL to grab (ie:
http://slashdot.org/ )
- Language: native language of the website (ie:
English )
- MyNews Id: if the template is registered in the MyNews distant site, this field contains the id of the template in the MyNews distant site (generally the same as Id, usefull for update, ie:
slashdot )
- Last update: if the template is registered in the MyNews distant site, this field contains the date of the last time the template was update from the MyNews distant site (ie:
11/11/2004 15:32:28 )
News: information about how to extract news from the website URL. All fields of this part are perl regular expressions. Values are extracted from the HTML code of the website URL by using () characters. Special characters ( . ? + ...) must be preceeded by \ character. For more information about perl regular expressions, run:
> perldoc perlre
- Start: perl regexp to detect the beginning of the news in the HTML code of the website URL
- End: perl regexp to detect the ending of the news in the HTML code of the website URL
- Id: perl regexp to extract the news id. The news id must be unique for the website. It allows MyNews to build the link to the news (ie:
(\d+/\d+/\d+/\d+)\.shtml[^>]+><B>Read More\.\.\. )
- Name: perl regexp to extract the news title (ie:
SIZE="4" COLOR="FFFFFF"><B>(.*)</B> )
- Date: perl regexp to extract the news date (optional, three values: year, month, day, ie:
/(\d+)/(\d+)/(\d+)/\d+\.shtml[^>]+><B>Read More\.\.\. )
- First line: perl regexp to detect the beginning of the news body (string between () are kept in news body, ie:
(Posted by.*) )
- Last line: perl regexp to detect the ending of the news body (optional, string between () are kept in news body, ie:
Read More\.\.\. )
Links: information to build links to the website.
- News: to build the link to a news. %s is replaced by the news id. If two %s appear in this field, the first one is replaced by the news topic id and the second one is replaced by the news id (ie:
http://slashdot.org/articles/%s.shtml )
- Template icon: URL of the template icon (ie:
http://images.slashdot.org/topics/topicslashdot.gif )
- Topic icon: to build the link to the icon of a topic. %s is replaced by the topic icon name (optional, ie:
http://images.slashdot.org/topics/%s )
Topic: information about how to extract topics from the website URL. All fields of this part are perl regular expressions.
- Id: perl regexp to extract the topic id. The topic id must be unique for the website (ie:
search\.pl\?topic=(\d+) )
- Name: perl regexp to extract the topic name (for display purpose, ie:
TITLE="([^"]+)"></A><BR> )
- Icon: perl regexp to extract the topic icon file name (ie:
/topics/(.*.gif) )
Search / Replace: to perform some cleaning operations in the news body. Each line of the Search field is treated as a single regexp. The corresponding line in the Replace field is used to perform the string replacement. If there is no corresponding line, the search string is removed from the news body. For example to suppress extra tags in the news body, you can set Search to: <[^>]*> and leave Replace empty.
You can test the template extraction by clicking on the
button. Extracted news are not saved in database. When the extraction seems OK, you submit template changes by clicking on the
button.
Importing/Exporting template
Templates can be exported as .mnt file by clicking on the
button of the template editor.
Templates can be imported from .mnt file by selecting the .mnt file and clicking on the
button of the template editor.
Updating template from MyNews website
A list of available templates is stored on the MyNews website. Those templates are maintained and updated when corresponding websites change their HTML code. A news is generated on the MyNews website when a template has been changed or when new template has been added. You can use your MyNews site to grab the news by using the MyNews template. News contains a link to update your template.
You can also check for recent changes by clicking on the
button. Templates are displayed in a list with a status icon.
Icon |
|
: |
The template is up-to-date. No update is needed. |
|
|
: |
The template has been modified in the MyNews distant site. It needs to be updated. |
|
|
: |
The template has been added in the MyNews distant site. You can download it. |
In the template editor, you can force the template update by clicking on the
button.
Template status
The status is used to enable/disable the template. The Status colunm displays an icon corresponding to the template status:
Icon |
|
: |
The template is active. News are grabbed when you run the command mynews scan . Template is visible in the MyNews web interface. |
|
|
: |
The template is inactive. News are not grabbed when you run the command mynews scan . Template is hidden in the MyNews web interface. |
When you click on the status icon, you switch the template from active to inactive and vice versa.
Template icon
The icon of a template is grabbed from the template website.
You can reload the template icon from the website by clicking on the |
| icon. |
You can customize the template icon by clicking on the |
| icon. |
You can then select the icon you want to upload and click on the
button. The icon is changed when you click on the
button.
|