自己动手编写优快云博客备份工具-blogspider源码下载(4)

本文介绍了一款用于备份优快云博客的工具blogspider的升级版本blogspider_v2.0,解决了因优快云博客HTML文件格式变化导致的原版本出现的Segmentation fault错误,并提供了新版本的下载链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

作者:gzshun. 原创作品,转载请标明出处!
来源:http://blog.youkuaiyun.com/gzshun


本博文需要声明几点:

1.blogspider_v1.0源码已经更新,文件名为"blogspider_v2.0.tar.bz2",下载地址在下文。
2.该备份工具用其他语言(比如Java,PHP)可能比较简单,但本人只会C/C++。
3.blogspider_v1.0源码报错,原因是:优快云博客的HTML文件修改。我需要说明的是:请大家不要将该程序应用于非法用途,以免造成优快云网站服务器的负载,请遵循"备份优快云博客"原则。可能优快云技术人员发现该程序是直接解析HTML文件,所以修改HTML文件避免该程序的运行(猜想)。


前段时间比较忙,没时间回复大家的评论与邮件,在这里感谢各位同志的支持。一些哥们儿建议将blogspider源码上传到优快云的下载频道,正好今天有空,再把该系列文章做个总结,给大家提供blogspider下载地址。

前面已经写了几篇文章,需要的马上跳转:

自己动手编写优快云博客备份工具-blogspider

自己动手编写优快云博客备份工具-blogspider之源码分析(1)

自己动手编写优快云博客备份工具-blogspider之源码分析(2)

自己动手编写优快云博客备份工具-blogspider之源码分析(3)


一.blogspider程序提示"Segmentation fault"错误

最近blogspider程序会出现段错误,提示"Segmentation fault"错误。刚才我调试了一下,程序本身没有问题,原因是优快云博客的HTML文件的格式发生变化,所以strstr函数出错。本程序原来是直接分析HTML文件来获取博客信息,所以blogspider存在这个局限性,我已经修改最新的HTML文件的解析函数,出错在analyse_index函数中。
以下是diff命令的结果:

--- blogspider_src.c	2012-01-16 01:12:15.657184878 +0800
+++ blogspider_update.c	2012-01-16 01:09:19.629534441 +0800
@@ -570,6 +570,7 @@
 static int analyse_index(blog_spider *spider_head)
 {
 	FILE *fp;
+	int i;
 	int ret;
 	int len;
 	int reads, comments;
@@ -610,14 +611,29 @@
 				sprintf(url, "%s%s", 优快云_BLOG_URL, posA);
 
 				/*查找博客标题*/
+				#if 0
 				posB += 1;
 				posC = strstr(posB, BLOG_TITLE);
 				/*与博客地址处在同一行*/
 				posC += strlen(BLOG_TITLE);
 				posD = strstr(posC, "\">");
 				*posD = 0;
-				memset(title, 0, sizeof(title));
-				strcpy(title, posC);
+				#else
+				/*在博客地址的下一行*/
+				fgets(line, sizeof(line), fp);
+				
+				i = 0;
+				while (1) {
+					/*从第一个不是空格的字符开始读取*/
+					if (line[i] != ' ') {
+						memset(title, 0, sizeof(title));
+						line[strlen(line) - 1] = 0;
+						strcpy(title, line + i);
+						break;
+					}
+					i++;
+				}
+				#endif
 
 				/*查找博客发表日期*/
 				while (fgets(line, sizeof(line), fp)) {

二.blogspsider_v2.0运行结果,可以成功备份优快云博客

gzshun@ubuntu:~/c/blogspider_v2.0$ ./blogspider gzshun
......................................
优快云 ID : gzshun
TITLE   : Open Linux C/C++专栏
URL     : http://blog.youkuaiyun.com/gzshun
访问:69747次
积分:1339分
排名:第4132名
原创:32篇
转载:6篇
译文:0篇
评论:302条
Download    ==>  2012-01-29 16:48  1.自己动手编写优快云博客备份工具-blogspider之源码分析(3)
Download    ==>  2012-01-20 23:27  2.自己动手编写优快云博客备份工具-blogspider之源码分析(2)
Download    ==>  2012-01-17 23:16  3.自己动手编写优快云博客备份工具-blogspider之源码分析(1)
Download    ==>  2012-01-15 16:40  4.自己动手编写优快云博客备份工具-blogspider
Download    ==>  2012-01-12 23:32  5.2011年各大知名软件公司校招聘软件研发类薪资待遇
Download    ==>  2012-01-06 23:27  6.如何编写一个完整的Linux命令
Download    ==>  2012-01-05 12:48  7.北漂族一票难求
Download    ==>  2012-01-03 17:45  8.Android源码分析系列-整理篇
Download    ==>  2012-01-03 10:22  9.Android-Vold, Framework和UI的通信-大结局(12)
Download    ==>  2012-01-02 19:25  10.Android-vold源码分析之连接电脑OTG(11)
Download    ==>  2012-01-01 22:34  11.张孝祥老师,您一路走好!
Download    ==>  2012-01-01 18:01  12.一个北漂程序员在新年的反思
Download    ==>  2012-01-01 11:15  13.Android-vold源码分析之格式化SD卡(10)
Download    ==>  2011-12-31 21:20  14.Android-vold源码分析之卸载SD卡(9)
Download    ==>  2011-12-30 20:15  15.Android-vold源码分析之挂载SD卡(8)
Download    ==>  2011-12-29 22:12  16.Android-vold源码分析之runCommand(7)
Download    ==>  2011-12-28 23:10  17.Android-vold源码分析之startListener(6)
Download    ==>  2011-12-27 23:41  18.嵌入式Linux下fdisk处理磁盘MBR的可选ID
Download    ==>  2011-12-27 22:32  19.Android-vold源码分析之handleBlockEvent(5)
Download    ==>  2011-12-26 22:30  20.Android磁盘管理-之vold源码分析(4)
Download    ==>  2011-12-25 00:02  21.Android磁盘管理-之vold源码分析(3)
Download    ==>  2011-12-23 22:38  22.Android磁盘管理-之vold源码分析(2)
Download    ==>  2011-12-22 21:47  23.Android磁盘管理-系统源码分析(1)
Download    ==>  2011-12-18 16:10  24.C语言sscanf函数的总结
Download    ==>  2011-12-17 21:28  25.CRC32校验算法-C实现
Download    ==>  2011-12-10 12:49  26.软件行业排名前100名的企业大全
Download    ==>  2011-12-08 21:16  27.Android移植oprofile性能监测工具
Download    ==>  2011-12-07 21:42  28.移植mtd-utils工具包--使用教程
Download    ==>  2011-12-07 21:39  29.移植fontconfig软件包
Download    ==>  2011-11-22 23:10  30.Ubuntu Server基本的环境搭建
Download    ==>  2011-11-21 23:43  31.开发环境的小见解
Download    ==>  2011-11-19 00:00  32.经典网站
Download    ==>  2011-11-18 23:41  33.创业及野心的一定要看
Download    ==>  2011-11-18 23:19  34.创业公司CEO每周应该做的13件事
Download    ==>  2011-11-18 23:15  35.开始写博客
Download    ==>  2011-07-21 22:13  36.我的优快云博客终于能用了
Download    ==>  2011-03-05 12:10  37.如何坚持嵌入式学习(转载)
Download    ==>  2010-11-19 08:22  38.[转载]中国最致命的薄弱环节!(一个机械类毕业生的心声)

三.下载地址

春节期间,大家都很忙,赶着给亲朋好友拜年,我也不例外,时间比较少。很多同志们依然奋斗,向我要blogspider的源代码,除了优快云博客的评论脚印,还有私底下发给我的已经有上百份,我想不是办法,我将本程序上传到优快云的下载频道供大家下载。

优快云博客备份工具:blogspider_v2.0.tar.bz2点击这里进入下载页面


四.联系方式

若程序出现问题,可以联系我的邮箱:gzshuns#163.com (# -> @)

我发现搞Linux的同行非常多啊,大家都是Linux程序员,希望有一个交流平台,今天下午我创建了一个,欢迎Linux开发程序员的加入!
:Linux开发程序员 (210563904)。
希望能在本群认识 志同道合 的Linux开发程序员!

## Tracking with Kernelized Correlation Filters Code author : Tomas Vojir ________________ This is a C++ reimplementation of algorithm presented in "High-Speed Tracking with Kernelized Correlation Filters" paper. For more info and implementation in other languages visit the [autor's webpage!](http://home.isr.uc.pt/~henriques/circulant/). It is extended by a scale estimation (use several *7* different scales steps) and by a RGB (channels) and Color Names [2] features. Data for Color Names features were obtained from [SAMF tracker](https://github.com/ihpdep/samf). It is free for research use. If you find it useful or use it in your research, please acknowledge my git repository and cite the original paper [1]. The code depends on OpenCV 2.4+ library and is build via cmake toolchain. _________________ Quick start guide for linux: open terminal in the directory with the code $ mkdir build; cd build; cmake .. ; make This code compiles into binary **kcf_vot** ./kcf_vot - using VOT 2014 methodology (http://www.votchallenge.net/) - INPUT : expecting two files, images.txt (list of sequence images with absolute path) and region.txt with initial bounding box in the first frame in format "top_left_x, top_left_y, width, height" or four corner points listed clockwise starting from bottom left corner. - OUTPUT : output.txt containing the bounding boxes in the format "top_left_x, top_left_y, width, height" ./kcf_trax - using VOT 2014+ trax protocol (http://www.votchallenge.net/) - require [trax](https://github.com/votchallenge/trax) library to be compiled with opencv support and installed. See trax instruction for compiling and installing. ___________ Performance | | **VOT2016 - baseline EAO** | **VOT2016 - unsupervised EAO** | [**TV77**](http://cmp.felk.cvut.cz/~vojirtom/dataset/index.html) Avg. Recall | |:---------------|:--------------:|:------------------:|:----------------:| | kcf |0.1530 | 0.3859 | 51% | | skcf |0.1661 | 0.4155 | 56% | | skcf-cn |0.178 | 0.4136 | 58% | | kcf-master |**0.1994** | **0.4376** | **63%** | __________ References [1] João F. Henriques, Rui Caseiro, Pedro Martins, Jorge Batista, “High-Speed Tracking with Kernelized Correlation Filters“, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2015 [2] J. van de Weijer, C. Schmid, J. J. Verbeek, and D. Larlus. "Learning color names for real-world applications." TIP, 18(7):1512–1524, 2009. _____________________________________ Copyright (c) 2014, Tomáš Vojíř Permission to use, copy, modify, and distribute this software for research purposes is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. __________________ Additional Library NOTE: The following files are part of Piotr's Toolbox, and were modified for usage with c++ src/piotr_fhog/gradientMex.cpp src/piotr_fhog/sse.hpp src/piotr_fhog/wrappers.hpp You are encouraged to get the [full version of this library here.](http://vision.ucsd.edu/~pdollar/toolbox/doc/index.html) ______________________________________________________________________________ Copyright (c) 2012, Piotr Dollar All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值