About Seacat

Seacat is the best web snapshot server in the world. It's based on Firefox browser, running on Linux system. For normal user, Seacat can take snapshot on user's favorite web pages, save them as pictures for future use. For internet sites, such as general search engine, vertical search engine, online bookmarks, online guide, map service and so on, taking snapshot on web pages by Seacat, can enrich user interface, enhance user experience, and improve search accuracy effectively. By Seacat, you can add more value on your web site, improve your internal value.

Features

  1. Run on background

    As a linux server program, Seacat runs on background. No need for X-Windows.
  2. Multithreaded with thread pool

    Running in multithreaded mode, Seacat can serve many user's snapshot request simultaneously.
  3. Various thumbnail sizes

    Default sizes are 1024x768 and 160x120, but user can specify many other thumbnail sizes.
  4. Various image formats

    Default output image format is png, but you can specify other format, such as gif, jpg...
  5. Full page snapshot support

    Taking snapshot on full web page made easy by Seacat, just use an option ( enable-full:1 ).
  6. Simpe interface

    Http like protocol, communication through socket, embedding in dynamic web applications should be very easy. The obvious sample is zhuatang.com.

Download

seacat-4.1-1.en_US.fc9.i386.rpm (For Fedora Core 9 Linux) (58)
seacat-4.1-1.en_US.fc8.i386.rpm (For Fedora Core 8 Linux) (188)
seacat-4.1-1.en_US.el5.i386.rpm (For RedHat EL 5/CentOS Linux) (129)

NEW 20080721: Code based on Firefox 3.0.1, fix some bugs.
20080621: Code based on Firefox 3.0.
20080609: Code based on Firefox 3.0rc2, provide seacatctl command, fix some bugs.
20080524: Code based on Firefox 3.0rc1, use thread pool technology.

Total downloads: 1458

Install prerequisite

For proper use Seacat, you must install ImageMagick at first. Make sure the file /usr/bin/convert and /usr/bin/composite exists and can execute.

Install

Install: rpm -ivh seacat*.rpm

Seacat server management

Configuration tool - seacatctl

usage: seacatctl command
where command is: 
1)  list
list current settings
2) set [port|rcj|vxsmin|vxsmax|pictureHome|captureWaitTime|waterMark] value
set config
3) proxy [ on <IP> <PORT> | off ]
set or clear proxy setting
4) help
print this help info
Example 1: seacatctl list
List current settings.
Example 2: seacatctl set port 4444
Set Seacat listen on 4444 port.
Example 3: seacatctl set rcj 4444-5555-6666
Set register code to 4444-5555-6666.
Example 4: seacatctl set vxsmin 5
Start 5 virtual browser when Seacat starts.
Example 5: seacatctl set pictureHome /root
Default picture storage home is /root.
Example 6: seacatctl set captureWaitTime 1500
Set wait time before capture to 1500ms.
Example 7: seacatctl set waterMark zhuatang.com
Set watermark text to zhuatang.com.
Example 8: seacatctl proxy on 192.168.28.91 8080
Set proxy : 192.168.28.91, port 8080.
Example 9: seacatctl proxy off
Clear proxy.
Note:vxsmax not used.

Command line capture tools - capture

usage: capture [-h host] [-p port] [-f] [-s WWWxHHH...] [-w timeToWait] [-o imageFormat] url1 url2 ...
Options:
-h host which Seacat listens on, default: localhost
-p port which Seacat listens, default: 5060
-f enable full page snapshot
-s specify various thumnail sizes, such as "400x300 800x600"
-w wait time before capture (unit: milliseconds)
-o image output format, default: png. 
url1 url2... URLs you want to take snapshot on.
Output:
<url> {+++|---} <scid>

+++ capture OK
--- capture failed
<scid> is prefix of snapshot filename. you can use "ls <scid>*" listing image files created for the <url>. Snapshot file full name format: <scid>-WWWxHHH.png, where WWW is image width, HHH is image height. When full pagesnapshot enabled, <scid>-full.png snapshot file will be generated.
Example1: capture www.zhuatang.com www.wenwenba.com
Example2: capture -s "109x82 330x220" www.zhuatang.com www.wenwenba.com
Example3: capture -f -s "82x78 400x300" www.zhuatang.com www.zaobao.com

Register

Seacat is a shareware, free trial time is 30 days. For your proper use, please register it on time.
Contact with zhsoft88@gmail.com (Email/MSN). Price: RMB4000.00.

Seacat Protocol

Example codes

Seacat.java Download (159)

package com.syntimes.commons;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.util.StringTokenizer;

import org.apache.commons.lang.math.NumberUtils;

/**
 * seacat capture
 * @author zhsoft88
 * @since 2008-4-13
 */
public class Seacat {

	public static final int PORT = 5060;
	
	/**
	 * capture result
	 * @author zhsoft88
	 * @since 2008-4-13
	 */
	public static class SeacatResult {
		private int status;
		private String scid;
		private long time;

		public SeacatResult(int status,String scid,long time) {
			this.status = status;
			this.scid = scid;
			this.time = time;
		}

		public long getTime() {
			return time;
		}

		public int getStatus() {
			return status;
		}

		public String getScid() {
			return scid;
		}
		@Override
		public String toString() {
			return "[status="+status+",scid="+scid+",time="+time+"]";
		}
	}
	
	/**
	 * capture configuration
	 * @author zhsoft88
	 * @since 2008-4-13
	 */
	public static class SeacatConf {
		private String url;
		private String thumbSizes;
		private int waitTime;
		private boolean enableFull;
		private String pictureHome;
		private String prefix;
		private String suffix;
		private String renameTo;
		private String postData;

		public SeacatConf() {
			waitTime = -1;
			enableFull = false;
		}
		public String getUrl() {
			return url;
		}
		public void setUrl(String url) {
			this.url = url;
		}
		public String getThumbSizes() {
			return thumbSizes;
		}
		public void setThumbSizes(String thumbSizes) {
			this.thumbSizes = thumbSizes;
		}
		public int getWaitTime() {
			return waitTime;
		}
		public void setWaitTime(int waitTime) {
			this.waitTime = waitTime;
		}
		public boolean isEnableFull() {
			return enableFull;
		}
		public void setEnableFull(boolean enableFull) {
			this.enableFull = enableFull;
		}
		public String getPictureHome() {
			return pictureHome;
		}
		public void setPictureHome(String pictureHome) {
			this.pictureHome = pictureHome;
		}
		public String getPrefix() {
			return prefix;
		}
		public void setPrefix(String prefix) {
			this.prefix = prefix;
		}
		public String getSuffix() {
			return suffix;
		}
		public void setSuffix(String suffix) {
			this.suffix = suffix;
		}
		public String getRenameTo() {
			return renameTo;
		}
		public void setRenameTo(String renameTo) {
			this.renameTo = renameTo;
		}
		public String getPostData() {
			return postData;
		}
		public void setPostData(String postData) {
			this.postData = postData;
		}
		
	}
	
	private String host;
	private int port;
	
	public Seacat() {
		this("localhost");
	}
	
	public Seacat(String host) {
		this(host,PORT);
	}
	
	public Seacat(String host,int port) {
		this.host = host;
		this.port = port;
	}
	
	/**
	 * capture web page
	 * @param conf
	 * @return
	 * @throws Exception
	 */
	public SeacatResult capture(SeacatConf conf) throws Exception {
		long t1 = System.currentTimeMillis();
		Socket socket = new Socket(host,port);
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
		if (conf.getUrl()!=null) {
			bw.write("get "+conf.getUrl()+"\r\n");
		}
		if (conf.getThumbSizes()!=null) {
			bw.write("thumb-sizes: "+conf.getThumbSizes()+"\r\n");
		}
		bw.write("enable-full: "+(conf.isEnableFull()?"1":"0")+"\r\n");
		if (conf.getWaitTime()!=-1) {
			bw.write("wait-time: "+conf.getWaitTime()+"\r\n");
		}
		if (conf.getPictureHome()!=null) {
			bw.write("picture-home: "+conf.getPictureHome()+"\r\n");
		}
		if (conf.getPrefix()!=null) {
			bw.write("prefix: "+conf.getPrefix()+"\r\n");
		}
		if (conf.getSuffix()!=null) {
			bw.write("suffix: "+conf.getSuffix()+"\r\n");
		}
		if (conf.getRenameTo()!=null) {
			bw.write("rename-to: "+conf.getRenameTo()+"\r\n");
		}
		if (conf.getPostData()!=null&&conf.getPostData().length()>0) {
			bw.write("content-length: "+conf.getPostData().length()+"\r\n");
		}
		bw.write("\r\n");
		if (conf.getPostData()!=null&&conf.getPostData().length()>0) {
			bw.write(conf.getPostData());
		}
		bw.flush();
		BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream(),"utf-8"));
		String line = br.readLine();
		int status = -1;
		StringTokenizer st = new StringTokenizer(line," ");
		st.nextToken();
		status = NumberUtils.toInt(st.nextToken());
		String scid = null;
		while ((line=br.readLine())!=null) {
			if (line.length()==0) break;
			if (line.startsWith("SCID: ")) {
				scid = line.substring(6);
			}
		}
		socket.close();
		long t2 = System.currentTimeMillis();
		return new SeacatResult(status,scid,t2-t1);
	}
	
}

TestSeacat.java Download (154)

package com.syntimes.commons.tests;

import com.syntimes.commons.Seacat;
import com.syntimes.commons.Seacat.SeacatConf;
import com.syntimes.commons.Seacat.SeacatResult;

public class TestSeacat {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		Seacat seacat = new Seacat();
		SeacatConf conf = new SeacatConf();
		conf.setUrl("http://localhost:8080/docs/");
		conf.setThumbSizes("160x120 1027x768");
		conf.setWaitTime(1000);
//		NameValuePair[] pairs = {
//				new NameValuePair("name","zzz"),
//				new NameValuePair("age","23"),
//		};
//		String charset = "gb2312";
//		conf.setPostData(EncodingUtil.formUrlEncode(pairs, charset));
		SeacatResult result = seacat.capture(conf);
		System.out.println(result);
	}

}

Products: Seacat Seaflower Seaspider Seasnipe Seastar NEW
(C) 2008 ZHUATANG.COM All rights reserved (网站备案中)

2008-07-21