⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bk2site.1

📁 一百个病毒的源代码 包括熊猫烧香等 极其具有研究价值
💻 1
📖 第 1 页 / 共 3 页
字号:
<!--bk2site:top <a href="http://www.slashdot.org">Slashdot News</a><ul>--><!--bk2site:bottom </ul>--><!--bk2site:template <li><A HREF="%URL">%TITLE</A> %CONDDASH %COMMENT--><!--bk2site:cols 1--><!--bk2site:maxnum 10--><!--bk2site:end-->.EENotice that since the channel files contain less information thanbookmark files, the only tags you can use in your channel template are%TITLE, %URL, %COMMENT, %CONDDASH, and %HITS. Using the others will%have unpredictable results..SH Dealing with other character setsIf you do not use the ASCII character set, or use some of those accentedcharacters, you might find that you need to use %NOACCENTURL insteadof %URL. You might also want to place the comment DIRNAME followed bya folder name, e.g. DIRNAME myasciifoldername, when the title of your foldercontains characters that do not make for good folder names. The folderwill instead be given the name you gave it.If you do not use DIRNAME, bk2site will transform any non-ascii charactersinto their hex equivalents and use that as the folder name (not very prettybut works well as a URL)..SH search.pl programAfter you compile the sources you will also find a program called"search.pl". This program is a cgi-script which reads a urls.db fileautomatically created by bk2site and returns the number of matches toany given query. It takes several arguments:.IP qThe query we want to match. It can be a word or a series of wordsseparated with spaces..IP numThe total number of results to display per page..IP stq The number of the first result to display. This is use for displayingthe "next 10 results"..IP dbThe name of the urls.db file..PPThe program needs to be moved to your cgi-bin directory.The cgi-bin dir must have:.EXsearch.plurls.dbsearchbase.html.EEYou must also edit the program search.pl. The line (near the top):.EX$searchprog = "/cgi-bin/search.pl"; .EEmust be changed to point to where you put seach.pl, if different fromthe default value..IP urls.db is created automatically by bk2site, see the comments indot.bk2siterc for how to generate it and other info. Notice that thedefault is for this file to NOT be generated. .IP searchbase.html could be a copy of the previous otherbase.html, or youcould make some other cosmetic changes to it. A sample searchbase.html file is included with the distribution. search.pl will use this fileas a template for its output..PPThe search.pl program will also replace all occurences of %QUERY and%NUMBER in searchbase.html, with their appropiatevalues. %ESCQUERY can also be used---it is the same as %QUERY but thespaces and other special characters are escaped. See the samplesearchbase.html for an example of how to use this.If you use %IFCOMHAS(*cool*)(<img ....), with *cool* or whatevername(s) you use (e.g. *lame*, -biz-, etc). You can now do searches onthis. For example, to have a "Whats cool" link, you do:.EX<a href="/cgi-bin/search.pl?q=*cool*&num=20">Whats Cool</a>..EE.SH Counting the HitsTo do this you must first use redirect.pl (or equivalent) to count the number of hits. To do this you must change the templates so thatredirect.pl gets called with the urls you want to count, and thehits are displayed where (and how) you wand them.A simple exaple of a template is:.EX<!--bk2site:template<A HREF="/cgi-bin/redirect.pl?url=%URL">%TITLE</A> %NEW <font color="red">%HITS</font> %CONDDASH %COMMENT-->.EEThen set.EXurllogfile 	/home/httpd/cgi-bin/urllog.EEto point to the urllog file generated by redirect.pl, and.EX#Hits older than this many SECONDS # will be ignored and purged from the#urlloggile  2592000 = 30dayshitstimecutoff	2592000.EEThen you are ready to run bk2site.bk2site will read the urllog file and then WRITE IT BACK but it willNOT WRITE back those hits that are before the hitstimecutoff..SH "SAMPLE ~/.bk2siterc".EX# Sample .bk2siterc by Jose M. Vidal## Multiuser support by Bradley Bell <btb@debian.org>## http://bk2site.sourcefore.net## This file customizes the behavior of bk2site. bk2site looks # for this file in ~/.bk2siterc. Otherwise, the file can be # given with the -f parameter. Command-line arguments override# values set in this file.## The format is a variable name followed by a value, with some # whitespace in between. The value has to be ON THE SAME LINE# as the variable.# I show all the variables available, along with some example # values. Any line that starts with # is a comment.## If you use either $HOME or $USER or $LOGNAME they will be # replaced with# their values as given by the shell when bk2site is run.# For example# destdir	$HOME/www# sets the destination directory to be www under the user's home.# NOTE: if you run bk2site as a cron job, $USER is not defined#  (on Linux)# The directory where bk2site places the files.#destdir		/home/httpd/html/# When testing you might want to set it to#destdir         /tmp/#on a multiuser system you can use:destdir		$HOME/public_html/bk2site/# This is the HTML that will be placed in place of any %NEW#  tags you place in your templates. Typically, this is a gif.# Notice that you can use directives here.newgif	<img src="/icons/new.gif" alt="Added %MONTHCRE1/%DAYCRE/%YEARCRE"># You can have bk2site reset the folders' creationtime to# be either:# maxdescendants --the max of all the urls that are descendants#                  of this folder.# maxchildren --the max of all the urls that are children of this#               folder# normal --leave it alone. The creation time is the time you created#          the folder#You set it to maxdescendants if you want to see the new.gif next# to all the folders that contain new urls.foldercreation maxdescendants# The bookmark file you want to use#bookmarkfile	/tmp/bookmark.html# use the regular netscape bookmarks#bookmarkfile	/home/jmvidal/.netscape/bookmarks.html# Leaving it blank tells it to use ~/.netscape/bookmarks.htmlbookmarkfile	# The name of the file we write the published bookmarks to.#outputbookmarkfile	/tmp/published-bookmarks.html# The name of the folder you want to publish#topfolder	PUBLIC# leave it blank if you want all your bookmarks published.topfolder#The title you want to give to your pagestitle	$LOGNAME's bookmarks#The folder for the news. I needs to be a subfolder of topfolder#newstopfolder	News#leave empty if you do not want news.newstopfolder#Do you want bk2site to add HTML comments to its output stating# where it did the replacements? yes or nocomments	yes# The names of the indexbase.html and otherbase.html:# use a relative directory (not good if you are using cron)# In the RPM version, the sample files are located at /etc/bk2site/# indexfilename	/etc/bk2site/indexbase.htmlotherfilename   /etc/bk2site/otherbase.html# The names of any other filenames you want to create, along with the# name of their index files (relative to destdir).# For example, if you want an extra file with new additions you say:extrafilebase	/etc/bk2site/newbase.htmlextrafilename	new.html#You can add more pairs, like:#extrafilebase	/etc/bk2site/tophitsbase.html#extrafilename	tophits.html# The channels you (might) want to display# For each channel you must define three variables# first the name you will use to refer to this channel (in the base files)#channelname slashdot# the url for retrieving it (can be either http: or file:)#channelurl http://slashdot.org/slashdot.rdf# a filename where we will write a copy of this channel. Also, if the url# cannot be read we will try to read the channel from this file.#channelfile /tmp/slashdot-channel#channelname freshmeat#channelurl http://freshmeat.net/backend/fm.rdf#channelfile /tmp/freshmeat-channel#channelname multiagent#channelurl http://www.multiagent.com/mynetscape.rdf#channelfile /tmp/multiagent-channel#channelname lwn#channelurl http://lwn.net/headlines/rss#channelfile /tmp/lwn-channel#You can add as many as you want. Note that extrafilename will pre#prepended by whatever you specify in destdir.# The number of days we leave the new.gif next to a urltimecutoff	30# The string to use for the word "Top" which appears in the navigatebartop		Top# or, in another language# top		Cumbre#the name of your index.html fileindex		index.html#or in DOS world#index 		index.htm#The name of the file you will use for the %HITS This file must#contain a bunch of times and urls (as generated by#redirect.pl, for example).  Leave empty if you don't want this#feature. bk2site will read and WRITE to this file.#urllogfile#Note that redirect.pl by default writes to a file called "urllog"# that is in the cgi-bin directory. So, typically, you might want:#urllogfile /home/httpd/cgi-bin/urllog#Hits older than this many SECONDS will be ignored and purged from the#urlloggile, 2592000 = 30 dayshitstimecutoff	2592000#If you want the tophits section to also include the news items (assuming# the news folder is under topfolder) then set this variable to "yes".#The defaults is "no", which means that the top hits only include directory# entries and not news items.tophitsincludenews	no#STUFF BELOW deals with search program#if you want to generate "urls.db", which is needed by the search program# then include here the full path. It needs to reside on the same# directory you put the "search" program. The file MUST BE NAMED# urls.db#search		/home/httpd/cgi-bin/urls.db# if you do not want search, just leave it blank#search#on a multiuser system you can do:search 		$HOME/public_html/bk2site/urls.db#This is the path that takes us from the cgi-bin directory (i.e. the#results page) to the root (Top) of your bookmarks.  If your bookmarks#reside on / and your search in /cgi-bin/bk2site, then:#searchtorootpath ../../ If your Top is in a subdir then#searchtorootpath ../subir/ If the search is done on a different#machine, then #searchtorootpath http://machinewithbookmarks.org/bookmarks/ #on a multiuser system you can do:searchtorootpath	/~$LOGNAME/bk2site/#The url template to use for the search results. This should probably# be the same template you use for the urls in the otherbase.html file.# BUT: note that search.pl automatically prepends every url with an <li>#searchurltemplate <A HREF="%URL">%TITLE</A> %NEW <font color="red">%HITS</font> <A HREF="http://www.hotbot.com/?clickSrc=search&MT=%URL&SM=url&DC=50"><img src="/icons/closeup.gif" border=0 alt="Who points to it?"></A> %IFCOMHAS(*cool*)(<img src="/images/cool.gif">) %CONDDASH %COMMENTsearchurltemplate <A HREF="%URL">%TITLE</A> %NEW %CONDDASH %COMMENT.EE.SH BUGSToo many to mention..SH AUTHORJose M. Vidal <bk2site-dev@lists.sourceforge.net>Contributors include:August Hoerandl - wrote check-meta.pl. added "date" tag.Bradley Bell - patch to support multiuser setups.Daniel Barrero - patch for handling flat file systemsReinier Mostert - patch to handle bookmark aliases.Oliver Obst - provided the autoconf scripts.Hannes Faestermann - patch for new.htmlDavid Cancel - cool ideas and code for improving search.plThe program homepage is at http://bk2site.sourceforge.net.SH "SEE ALSO".BR netscape (1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -