为帮母亲而写的php远程访问chrome书签的程序~

母亲有时会上网逛一下网店,有喜欢或须要的东西就用chrome收藏起来,我回来后帮她拍下付费。php

如何浏览到她收藏的东西是个问题,若是去她电脑上操做,须要登陆用户,装安全控件啥啥的弄一大堆,并且我喜欢先在米折上折一下,再买。再加上她电脑有点慢,每次都要弄半天。前端

想了想,写了个简单的程序。能够远程和本地访问chrome收藏文件。chrome

程序我打包放网盘了,请各位老师批评指正:http://pan.baidu.com/s/1pJ18ZYb json

程序用php开发,使用流行的CodeIgniter框架,前端用了zTree。 安全

很是很是简单,主要代码以下: app

配置文件:\Bookmarks\application\config\base_config.php 框架

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*基础配置*/
$config['where']='remote';//远程访问仍是本地访问,默认本地local,远程remote
$config['address_local']='C:\Program Files (x86)\Chrome\Google\Chrome\User Data\Default\Bookmarks';//本地地址
$config['address_remote']="//192.168.0.17/Default/Bookmarks";//远程访问地址
?>


控制器:this

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Bookmarks extends CI_Controller {
public function show($default='local')
{
$data['default']=$default;
$this->load->helper('url'); 
$this->load->config('base_config');
if($default=='local')  //用传参方式
{
$file= $this->config->item('address_local');
}
elseif($default=='remote')
{
$file= $this->config->item('address_remote');
}
else
{
exit('Parameter error!!');
}
if(file_exists($file))
{
$json=file_get_contents($file);
$data['json']=$json;
$arr=json_decode($json,true);
$data['json']=json_encode($arr['roots']['bookmark_bar']);
$this->load->view('bookmarks_view',$data);
}
else
{
$this->load->view('no_find_view',$data);
}
}
}


呵,有时为工做之外的事写个程序,也挺好玩的。url

程序我打包放网盘了,请各位老师批评指正:http://pan.baidu.com/s/1pJ18ZYb
spa

小弟个人微博:http://weibo.com/cavalryblack  有事木事联系联系~~



另外和你们说一下,米折颇有趣,想买什么东西前,把要买的标题放米折里过一下,再拍就有返利。固然返的和买东西的钱比,很是很是少。不过聊胜于无,到如今已经返我200多元了。我家今年的水费基本都是用米折返的钱交的~~ 地址素:  http://www.mizhe.com/#NEWnZ2ZUl2ZFp2

相关文章
相关标签/搜索