页面载入中...

和 "Google" 有关的文章

2007-11
14

Firefox扩展:浏览器同步

说 Firefox 是 Google 的自家浏览器一点都不为过,除了我们熟知的集成在 Firefox 中的 Google toolbar(工具条)和搜索引擎以及 AdSense 中的 Firefox 推介以外,Google 还开发了很多 Firefox 扩展,比如 Google Notebook、Google Reader Note 等(如果再算上非官方的插件,比如 Gmail、AdSense、Reader 等相关的,那就更多了)。

今天我介绍的这个扩展或许很多人都已经在使用了,那就是 Google Browser Sync (Google 浏览器同步)。今天使用 Ubuntu 的时候,为了解决在不同的操作系统下的 Firefox 书签共享问题,我才发现了这个扩展。安装了以后,Google Browser Sync 可以不停地同步你的浏览器设置(包括书签、浏览历史、cookies、保存的密码、上次关闭时的标签页等),经过加密后保存在 Google 的服务器中。这样你就可以在其他的任意一台电脑上或者不同的操作系统上通过安装这个扩展来实现 Firefox 的同步,非常方便。

同步账户通过 Gmail 帐户来调用,所以使用这个扩展的前提是你必须有一个 Gmail帐户。在同步帐户设置中可以设定一个 PIN 码,然后第一次访问保存在服务器上的数据时输入你设定的 PIN 码即可。

这个扩展的官方地址:http://www.google.com/tools/firefox/browsersync/

2007-10
28

Google PageRank更新了

这两天因为忙于一些事情,很少上网。昨天用手机上 Google Reader 的时候才发现万众瞩目的 PR 更新终于来临了,这次更新使得一些关于 Google 将取消 PageRank 的谣言不攻自破。相比国外一些著名 blogger 由于付费链接被 Google 降低 PR 的惩罚,国内的形势可谓“一片大好”,从我订阅的这些 blog 来看,大部分的中文 blog 都获得了 PR 的提升,很少有下降的。

值得一提的是,许许如生的主页 PR 也从0上升到了3,还有很多 PR 为1的页面,这有点出乎我的意料。我原以为最多也就是2,所以昨天刚看到我的 PR 为3的时候,着实兴奋了一下。对于一个刚建立3个月的 blog 来说,我已经非常知足了,呵呵。

2007-09
27

Google 9岁了

google 9th birthday

今天打开 Google 的主页,看到了这个 logo,Google 9岁了。

1997年9月15日,斯坦福大学两名24岁的学生拉里·佩琪和赛吉·布林注册了“google.com”域名。1998年9月27日,Google公司在加州北部的一个私家车库内诞生,Google 官方把1998年9月27日做为它的生日。

Google 是一个神奇的公司,总是能够带给我们新奇、实用的东西。祝愿 Google 继续续写互联网的传奇。

附: Google 历年生日 logo(从4岁开始) 还没有完呢,请继续阅读……

2007-09
13

开始用https访问Google Reader

我所在的教育网最近不知道是怎么回事,很多站点都无法访问,其中基本都是国外的。如果是因为开学了,教育网开始拥塞,也不应该访问不了,最多就是速度慢一些而已。所以我怀疑是学校把上个学期增加的那部分带宽给取消了。上学期为了迎接教学评估,学校增加了对外网的带宽,曾经很多教育网无法访问的国外站点都可以访问了,很令人欢欣鼓舞。但是好景不长,从8月底开始,很多国外网站开始无法访问,例如 netvibes

最近几天,连 google.com 都无法访问,以前访问 google.com 会直接跳转到 google.cn ,但是现在不行了,只能直接访问 google.cn 。同时 google.com 下的很多服务包括 Gmail 和 Google Reader 等当然也都不能访问了,以至于我每天都在怀疑 google.com 是不是被和谐了。所以按照月光博客的介绍,开始使用 HTTPS 的方式访问 Google Reader ,这样就没有问题了,而且速度还挺快,google 的其他几个服务如 Gmail 、流量分析、网站管理员工具、Adsense 等都可以使用 https 来访问。https 是对 http 的扩展,通过基于 SSL 对 http 进行分层来使用传输层的安全性,它比 http 更加安全,推荐使用 https 来访问这些服务。

附:HTTPS 简介

HTTPS(Secure Hypertext Transfer Protocol)安全超文本传输协议
它是由 Netscape 开发并内置于其浏览器中,用于对数据进行压缩和解压操作,并返回网络上传送回的结果。HTTPS 实际上应用了 Netscape 的完全套接字层(SSL)作为 HTTP 应用层的子层。(HTTPS 使用端口 443,而不是象 HTTP 那样使用端口 80 来和 TCP/IP 进行通信。)SSL使用 40 位关键字作为 RC4 流加密算法,这对于商业信息的加密是合适的。HTTPS和SSL支持使用X.509数字认证,如果需要的话用户可以确认发送者是谁。

HTTPS 是以安全为目标的 HTTP 通道,简单讲是 HTTP 的安全版。即 HTTP 下加入 SSL 层HTTPS 的安全基础是 SSL,因此加密的详细内容请看 SSL 。

2007-07
31

在WordPress中加入Google AJAX搜索

这两天在为博客添加 Google 搜索功能的时候了解到了 Google Ajax Search ,听闻其功能很强大,于是马上 Google 了一下,学习怎样加入到 WordPress 中,其实不只是 WordPress,所有的页面都可以使用 Google Ajax Search。

在使用过程中参考了徘徊在玻璃之城的文章 Google AJAX Search 使用简介,成功地将 Google AJAX Search 加入到了我的 blog 中。下面给大家分享一下具体怎样做:(更新:由于 Google Ajax 搜索代码很多,比较拖速度,故本站暂停使用。本文介绍的方法仍然有效。重新加入了 Google Ajax 搜索,演示地址请看存档页。)

首先你要做的是去 Google 的网站申请一个 Google AJAX Search API ,点击左下角的确认框,并且输入你的 blog 地址后,你会得到一个长长的 Key 。

然后把如下代码加入到你的 header.php 的 <head></head> 之间。

<script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=请在此处填写你的key" type="text/javascript"></script>
<script type="text/javascript">//<![CDATA[
function OnLoad() {
//
create a search control
var searchControl = new GSearchControl();
searchControl.setLinkTarget(GSearch.LINK_TARGET_SELF); //可选项,如果删除此行,搜索结果将在新页中打开
searchControl.setResultSetSize(GSearch.LARGE_RESULTSET); //可选项,如果删除此行,搜索结果将从10条变为4
 
//
create a draw options object so that we
//
can position the search form root
var options = new GdrawOptions();
options.setSearchFormRoot(document.getElementById("searchForm"));
options.setDrawMode(GSearchControl.DRAW_MODE_TABBED);
 
var siteSearch = new GwebSearch();
siteSearch.setUserDefinedLabel("填入你的网站标签");
siteSearch.setUserDefinedClassSuffix("siteSearch");
siteSearch.setSiteRestriction("填入你的blog网址");
searchControl.addSearcher(siteSearch);
 
//
standard, unrestricted web search
searchControl.addSearcher(new GwebSearch());
 
searchControl.draw(document.getElementById("searchResults"), options);
}
GSearch.setOnLoadCallback(OnLoad);
//]]
>
</script>

几个需要修改的地方已经在代码中说明。

接下来就看你需要什么样的显示方式了,你可以选择把搜索栏和搜索结果分开显示,或者在一起显示。

1、分开显示:在你需要显示搜索结果的地方(例如 index.php 或 single.php 中)加入如下代码:

<div id="searchResults"/></div>

然后在你需要显示搜索栏的地方(例如 sidebar.php 中)加入如下代码:

<div id="searchForm"></div>

2、一起显示:在你需要显示搜索栏和结果的地方加入如下代码:

<div id="searchResults"/></div>

注意:把搜索栏和搜索结果一起显示不需要 <div id=”searchForm”></div>,在 <div id=”searchResults”/></div> 处会显示搜索栏和搜索结果。

最后,再把搜索栏和搜索结果的 CSS 样式加入你的 style.css 中,然后按照你自己的风格修改一下,就大功告成了。CSS 代码如下(需要修改的地方已经在代码中说明):

/** Copyright 2005 Google Inc. All rights reserved. */
 
/
* the GSearchControl CSS Classes
* .gsc-control :主显示框
*/
.gsc-control {
width: 98%;
}
 
.gsc-control div {
position: static;
}
 
/
* control inputs
* .gsc-search-box : 搜索栏大小
* .gsc-input : the text input area
* .gsc-keeper : the save link below savable results
*/
form.gsc-search-box {
width: 96%;
}
 
/
*
* This table contains the input element as well as the search button
* Note that the search button column is fixed width, designed to hold the
* button divs background image
*/
table.gsc-search-box {
width : 100%;
margin-bottom : 2px;
margin-top : 5px;
margin-left: -6px;
}
 
td.gsc-search-button {
width : 1%;
}
 
td.gsc-clear-button {
width : 14px;
}
 
/
**
* undo common generic table rules
* that tend to impact branding
*/
table.gsc-branding td,
table.gsc-branding {
margin: 0 0 0 0;
padding: 0 0 0 0;
border : none;
}
 
table.gsc-branding {
border-style : none;
border-width : 0px;
border-spacing : 0px 0px;
width : 100%;
}
 
td.gsc-branding-text {
vertical-align : top;
}
 
td.gsc-branding-text div.gsc-branding-text {
padding-bottom : 2px;
text-align : right;
color : #676767;
font-size : 11px;
margin-right : 2px;
}
 
td.gsc-branding-img-noclear {
width : 51px;
vertical-align : bottom;
}
 
td.gsc-branding-img {
width : 60px;
vertical-align : bottom;
}
 
input.gsc-search-button {
margin-left : 4px;
}
 
div.gsc-clear-button {
display : inline;
text-align : right;
margin-left : 4px;
margin-right : 4px;
padding-left : 10px;
background-repeat: no-repeat;
background-position: center center;
background-image: url(’http://www.google.com/uds/css/clear.gif’);
 
cursor : pointer;
}
 
/
*
* Given that this is sitting in a variable width tabel cell, the idea is
* for it to consume the entire cell. The adjacent cell contains the search
* button and that is a fixed width cell.
*/
input.gsc-input {
padding-left : 2px;
border-style : solid;
border-width : 1px;
border-color : #BCCDF0;
width : 99%;
}
 
/
* tabbed mode of search control
* .gsc-tabsArea : the box containing all of the tabs
* .gsc-tabsAreaInvisible : same as above, but this is the state when search has been cleared
* .gsc-tabHeader : an individual tab
* .gsc-tabHeader.gsc-tabhActive : the active tab
* .gsc-tabHeader.gsc-tabhInactive : an inactive tab
* .gsc-tabData : the data area/box containg results and header data for each tab
* .gsc-tabData.gsc-tabdActive : the data area for the active tab
* .gsc-tabData.gsc-tabdInactive : the data area for inactive tabs
*/
.gsc-tabsArea {
clear: both;
margin-top: 6px;
}
 
.gsc-tabsAreaInvisible {
display : none;
}
 
.gsc-tabHeader {
display: inline;
cursor: pointer;
display: inline;
padding: 2px 10px !important;
border: 1px solid #999; /*可修改搜索结果标题栏的边框颜色*/
border-bottom: none;
margin-bottom: 0;
margin-right: -6px; /*不要修改*/
margin-left: 10px; /*不要修改*/
}
 
.gsc-tabHeader.gsc-tabhActive {
background: #f3fce6; /*正在显示的搜索结果标题栏的背景*/
color: #0C72A2; /*正在显示的搜索结果标题栏的字体颜色*/
 
}
 
.gsc-tabHeader.gsc-tabhInactive {
 
}
 
.gsc-tabData.gsc-tabdActive {
display: block;
border: 1px solid #999; /*搜索结果显示栏的边框颜色*/
padding:10px;
background: #f3fce6; /*搜索结果显示栏的背景颜色*/
margin-bottom:10px; /*搜索结果显示栏内文字字体*/
font-size:14px;
}
 
/
*此代码只对IE6适用*/
* html .gsc-tabData.gsc-tabdActive {
display: block;
border: 1px solid #999; /*搜索结果显示栏的边框颜色*/
padding:10px;
background: #f3fce6; /*搜索结果显示栏的背景颜色*/
margin-bottom:10px; /*搜索结果显示栏内文字字体*/
font-size:14px;
margin-top:1px; /*不要更改,保证tab显示效果和firefox一致*/
}
 
/
*此代码只对IE7适用*/
*+ html .gsc-tabData.gsc-tabdActive {
display: block;
border: 1px solid #999; /*搜索结果显示栏的边框颜色*/
padding:10px;
background: #f3fce6; /*搜索结果显示栏的背景颜色*/
margin-bottom:10px; /*搜索结果显示栏内文字字体*/
font-size:14px;
margin-top:1px; /*不要更改,保证tab显示效果和firefox一致*/
}
 
.gsc-tabData.gsc-tabdInactive {
display: none;
}
 
/
* tab specific results header supression
* - no twiddle, tabbed mode runs in full expand mode
* - no title
* - no stats
*/
.gsc-tabData .gsc-resultsHeader .gsc-title {
display: none;
}
 
.gsc-tabData .gsc-resultsHeader .gsc-stats {
display: none;
}
 
.gsc-tabData .gsc-resultsHeader .gsc-results-selector {
display : none;
}
 
/
* the results for each section
* .gsc-resultsbox-{visible,invisible} : a complete-collection of results including headers
* .gsc-results : the collection of results for a given searcher
* .gsc-result : a generic result within the control. each result has this class, as well as .gsc-xxxResult where xxx is web, image, local, blog, etc.
*/
 
.gsc-resultsbox-visible {
display : block;
}
 
.gsc-resultsbox-invisible {
display : none;
}
 
.gsc-results {
clear: both;
padding-bottom: 2px;
}
 
.gsc-result {
margin-bottom: 10px;
}
 
.gsc-result .gs-title {
height: 1.4em;
overflow: hidden;
}
 
/
* specialized, result type specific, fine grained controls */
.gsc-result div.gs-watermark {
display: none;
}
 
/
* Ads
*/
.gsc-results .gsc-result img.gs-ad-marker {
display: none;
}
 
/
*** End of Control, Begin Results ***/
 
/
* generic, cross cutting result style
* - in the form of .gs-result .gs-xxx where xxx is the generic style
* .gs-title : typically the first line of a result, typically a link, image results over ride this, since for image results, the image is the link
* .gs-divider : typically seperates results from ads
* .gs-visibleUrl : typically the last line of a result, displayed in green. sometimes a link (like in blog search)
* .gs-clusterUrl : for news, and other similar services, this is a cluster of additional results
* img.gs-image : an actial image in a result
* .gs-phone : a phone number
* .gs-address : an address (includes street, city, region, country)
* .gs-streetAddress : a street (including #)
* .gs-city : a city
* .gs-region : a region (zip code, area, etc.)
* .gs-country : a country
* .gs-snippet : snippetized content
 
* .gs-watermark : indicator that user selected this result
* .gs-metadata : generic metadata, e.g.,
* .gs-image-box : generic container for a results image (within a table)
* .gs-text-box : generic container for a results text content (within a table). Note that this class, and image-box are only used in video
*/
.gs-result .gs-title,
.gs-result .gs-title * {
color: #0C72A2; /*搜索结果内容标题栏颜色 */
font-weight: bold;
text-decoration: underline;
padding-bottom:5px;
}
 
.gs-divider {
padding-bottom: 8px;
text-align: center;
color: #676767;
}
 
.gs-result a.gs-visibleUrl,
.gs-result .gs-visibleUrl {
color: #789d47; /*搜索结果来源网站的颜色 */
text-decoration: none;
}
 
.gs-webResult div.gs-visibleUrl-long {
width : 100%;
overflow : hidden;
display : none;
}