PEAK XOOPS - News in englishin japanese

Archive | RSS |
  
Poster : GIJOE on 2007-06-11 05:19:05 (9015 reads)

in englishin japanese
I'm itroducing the second sample of "parse joint".
This joint named D3pipesParseLinkhtml can fetch "publish time" and "link of the article" on the other hand, D3pipesParseSimplehtml can fetch only the "heading".

D3pipesParseLinkhtml has been already included the latest archive of d3pipes.

With the sample joint of D3pipesParseLinkhtml, you can make a pipe like this.
(Just a sample)


 0 Fetching from outside  snoopy    (URI of the page)
10 Transfer to UTF-8     (asyoulike)  The encoding of the page
20 Parsing XML           linkhtml   #([0-9/]{10}).*href=\"([^"]+)\"\>(.*)\</a\>#iU
30 Transfer from UTF-8   (asyoulike)  Internal encoding of your site
40 Clipping into local    moduledb   86400


It is defficult to describe the option as a regex pattern for linkhtml.

You have to know the meaning of each ().

1st () corresponds datetime (published)
2nd () corresponds link URI
3rd () corresponds the heading

Or

1st () corresponds link URI
2nd () corresponds the heading
3rd () corresponds datetime (published)

You have to make a regex pattern fitting the site you want to get information.

Read more... | 999 bytes more |0 comments

Poster : GIJOE on 2007-06-08 04:36:37 (9943 reads)

in englishin japanese
minahito has suggested new rule for the language directory.


(language name)_(encoding)   (*) all should be small letters

Of course, this change should be graced for the compatibilities.

eg)
French encoded ISO-8859-* should be named "french" as conventional.
French encoded UTF-8 should be named "fr_utf8" newly.

Though my modules contains "japaneseutf" as "Japanese encoded UTF-8",
they should be renamed "ja_utf8" gradually.

0 comments

Poster : GIJOE on 2007-06-03 06:40:29 (9401 reads)

in englishin japanese
Do you know 'intaller attack'?
If you leave 'install' folder in the public area of the server, attacker can know your DB password, DB prefix etc.
You should know attackers know the folder of 'install' can be renamed '_install' etc.

This is certainly a mistake of the user.
But I find checking a constant '_INSTALL_CHARSET' can protects your xoops from such attacks.

I've just updated the module Protector numbered 3.03 with the feature.

If you dare to use the installer after installing Protector, remove the precheck line from your mainfile.php


Poster : GIJOE on 2007-05-08 03:54:37 (12021 reads)

in englishin japanese
I had written language constants of D3 modules can be override by putting files under XOOPS_ROOT_PATH/modules/(dirname)/langauge/ from XOOPS_TRUST_PATH/modules/(trustdirname)/language/

But I found it is hard to use. (eg. Newly appended constants can be displayed its name instead of its value)

And I think CMS should be change its language constants not only via FTP but also "control panel".

Then, I've just implemented Language constants overriding system into altsys-0.5.

- mylangadmin
A controller called by each module's admin area. (like myblocksadmin or mytplsadmin)
This controller saves user values into DB(altsys_language_constants), then makes a cache file under XOOPS_ROOT_PATH/cache/

- D3LanguageManager
A singleton class for module/core on including language constants.
This class can be used like...


require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php' ;
$langman =& D3LanguageManager::getInstance() ;
$langman->read( 'main.php' , $mydirname , $mytrustdirname ) ;


At first, I've just added this feature into pico-1.31.
Let's try this. (Both altsys-0.5 and pico-1.31)

When the module increase its language constants, just update the cache via mylangadmin, again.

Perhaps, this overriding system can be used for almost modules running with XoopsCube Legacy 2.1 just by making a preload. (also, altsys should be modified a little)


Poster : GIJOE on 2007-04-27 05:16:04 (10045 reads)

in englishin japanese
It is quite easy to create a joint for d3pipes.
This is a sample to get renewal announcement from HTML.

With d3pipes, all you have to do is creating a class of parse joint.

Make a class definition file under
XOOPS_TRUST_PATH/modules/d3pipes/joints/parse/

In this document, the class is named as Simplehtml.

ClassName: D3pipesParseSimplehtml
FileName: D3pipesParseSimplehtml.class.php

Just write a method of execute() in the file.
execute() of "Parse" joint gets a string and returns array of entries.

Each entry should have 4 parameters.

'heading' : heading
'pubtime' : UnixTimestamp (Set it if you can)
'link' : URI of the article (Set it if you can)
'fingerprint' : ID of the article

With the sample joint of D3pipesParseSimplehtml, you can make a pipe like this.
(The site describe each renewal annoucement in <h2>)


 0 Fetching from outside  snoopy    (URI of the site)
10 Transfer to UTF-8     (asyoulike)  The encoding of the site
20 Parsing XML           simplehtml  #\<h2\>([^<]*)\</h2\>#iU
30 Transfer from UTF-8   (asyoulike)  Internal encoding of your site
40 Reassign              defaultlink (URI of the site)
50 Clipping into local    moduledb   86400

Read more... | 514 bytes more |0 comments

« 1 ... 6 7 8 (9) 10 11 12 ... 37 »
Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!