Xoops Module Digest 2.0



What is Digest

Digest is a web content fetching module that allows you to fetch, display and monitor any desired content from internet and to display on your site.

    Features:
  1. Supported fetch methods: CURL, fsockopen, fopen
  2. Multi-Categories
  3. The sites to be monitored, the content to be feteched can be configured by using a easy-to-use admin interface.
  4. Automatic update using cron job
  5. Allow users to test and submit sites.
  6. Table-free templates

1. Insatll

Install the "Digest" module as usual.

About Xconv module(Xoops Iconv): the xconv module is highly recommended for encoding conversion if PHP iconv module does not work well for you. Xconv is an extensible character encoding conversion module by which you can define your own conversion module. The full Chinese package has been available.
For details, visit: Xconv @ Xoops Dev Forge

2. How to use it

Server status:

    Detect and help configure your sites.
  • Fetch techniques: "CURL extension", "fsockopen function", "allow_url_fopen", you must have at least one available in order to use the Digest module.
  • Encoding conversion: "Iconv", "Xconv", you need at least one to fetch webpages that use other charset than your default charset.
  • Update API: you can update your Digest content automatically by calling this file externally, for instance, using cron job.

Add/edit sites:

    Add or edit websites that you would fetech contents. Brief guide:
  • Title: abbreviation of the site
  • URL: the URL of the page to be fetched
  • Order: for display order
  • Online: 1 - public; 0 - hide
  • Maximum items: max items to be fetched
  • Minmum length of valid title: item with shorter title will be ignored
  • Charset of the webpage: if the webpage does not choose a charset for itself, you have to help it :=)
  • Intermediate charset of the webpage: For some Chinese users only
  • Update time: the time interval that allows for new content fetch (in minutes)
  • Regexp for text filtering: some content may offend you, this filter will help a lot
  • Criteria for acceptable address: use this criteria to choose your desired links

3. Case study

Fetch "Recent Topics" at Xoops Official Site.

  • Title: Xoops
  • URL: http://www.xoops.org
  • Description: Xoops Official Forum
  • Order: 1
  • Online: 1
  • Maximum items: 20
  • Minmum length of valid title: 10
  • Charset of the webpage:
  • Update time: 30
  • Regexp for text filtering:
  • Criteria for acceptable address: viewtopic [comes from: http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=...]

4. Tips

Update Digest content automatically by using cron job

  1. the API file: XOOPS_ROOT_PATH/cache/digest/digest.php. The file is created during installation, you may re-create whenever it is deleted.
  2. add cronjob: the command to run: YourPhpPath XOOPS_ROOT_PATH/cache/digest/digest.php
  3. if you do not have cron, let someone else help update your digest using his cron: (http://)YourXoopsURL/cache/digest/digest.php
  4. At least, you can use pseudo-cron: put the link (http://)YourXoopsURL/cache/digest/digest.php to some page of your site, such as the include/common.php

5. Contact

Xoops China: http://xoops.org.cn
Acknowlegement: Speedy: http://bbface.com; insraq: http://insraq.xoops.cn/nuke