易截截图软件、单文件、免安装、纯绿色、仅160KB

Using Google is AJAX Search API with Java ...

http://www.ajaxlines.com/ajax/stuff/article/using_google_is_ajax_search_api_with_java.php
I was rather depressed over a year ago when Google deprecated their SOAP Search API with their AJAX Search API. Essentially Google was saying that they didn want anyone programmatically accessing Google search results unless they were going to be presenting the results unaltered in a rectangular portion of a website. This was particularly troubling to me because, like many academics, I have relied on the API to do automated queries, especially for Warrick.
A few months ago I got a little excited when Google opened their AJAX API to non-JavaScript environments. Google is now allowing queries using a REST-based interface that returns search results using JSON. The purpose of this API is still to show unaltered results to your website is user, but I don see anything in the Terms of Use that prevent the API being used in an automated fashion (having a program regularly execute queries), especially for research purposes, as long as you aren trying to make money (or prevent Google from making money) from the operation.
So, here is what I have learned about using the Google AJAX Search API with Java. I haven found this information anywhere else on the Web in one spot, so I hope you will find it useful.
Here is a Java program that queries Google three times. The first query is for the title of this blog (Questio Verum). The second query asks Google if the root page has been indexed, and the third query asks how many pages from this website are indexed. (Please forgive the poor formatting... Blogger thinks it knows better than I how I want my text indented. Argh.)
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import org.json.JSONArray; // JSON library from http://www.json.org/java/
import org.json.JSONObject;
public class GoogleQuery {
// Put your website here
private


相关文档:

四个有用的Java过滤器 Filter过滤器的使用

一、使浏览器不缓存页面的过滤器     
import javax.servlet.*;    
import javax.servlet.http.HttpServletResponse;    
import java.io.IOException;    
   
/**   
* 用于的使 Browser 不 ......

转载 java,gif,合成,拆分,jpg,图片生成

这几天一直在做图片处理,其中遇到了一些问题,在网上也找到了解决办法(虽然不是最佳的),在这里还是作个记录吧。
1 多张jpg图合成gif动画
/**
* 把多张jpg图片合成一张
* @param pic String[] 多个jpg文件名 包含路径
* @param newPic String 生成的gif文件名 包含路径
*/
private synchronized void jpgToGif(St ......

Java线程控制的图像分割与合成

Java是一种面向对象的编程语言。它具有与平台无关、面向对象、动态、安全等特点,允许直接使用多线程方式进行编程,对程序进行并发控制。Java还支持分布式网络操作,从而能够方便地进行网络文件对象的存取。利用Java语言本身提供的绘图功能,可以绘制一些简单的图形。而对于复杂图形,一般先用绘图软件制成图像,然后采用Ja ......

100行Java代码构建一个线程池

在现代的操作系统中,有一个很重要的概念――线程,几乎所有目前流行的操作系统都支持线程,线程来源于操作系统中进程的概念,进程有自己的虚拟地址空间以及正文段、数据段及堆栈,而且各自占有不同的系统资源(例如文件、环境变量等等)。与此不同,线程不能单独存在,它依附于进程,只能由进程派生。如果一个进程派生出了 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号