{
return KURL( datURL ).fileName().section( '.', 0, 0 ).toInt();
}
+
+/**
+ * http://pc5.2ch.net/linux/dat/1089905503.dat
+ * -> http://pc5.2ch.net/test/offlaw.cgi?bbs=linux&key=1089905503&sid=xxxxx
+ */
+QString Kita::datToOfflaw( const QString& datURL, const QString& sessionID )
+{
+ /* TODO: not tested. */
+ KURL url( datURL );
+ QString root = url.host();
+
+ url.cd( ".." );
+ QStringList list = QStringList::split( ".", url.fileName() );
+ if ( list.size() != 2 ) {
+ return QString::null;
+ }
+ QString datName = list[ 0 ];
+
+ url.cd( ".." );
+ QString board = url.fileName();
+
+ return QString( "%1/test/offlaw.cgi?bbs=%2&key=%3&sid=%4" ).arg( root, board, datName, sessionID );
+}
QString unescape( const QString& str );
int boardType( const QString& url );
uint datToSince( const QString& datURL );
+ QString datToOfflaw( const QString& datURL, const QString& sessionID );
}
#endif