Skip to content

Commit

Permalink
add fund123
Browse files Browse the repository at this point in the history
  • Loading branch information
fayland committed May 24, 2014
1 parent 83ba0f0 commit 025ce36
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
28 changes: 28 additions & 0 deletions js/qiandao/fund123.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
!function(win, doc, $){
$(doc).ready(function() {

chrome.runtime.sendMessage({method: "getLocalStorage", key: "fund123_status"}, function(res) {
var status = res.data;
var today = (new Date()).toDateString();
if (! (status && today === status)) {
// check if logined
if (doc.cookie.match(/user=/)) {
$.ajax({
type : "POST",
url : 'http://i.fund123.cn/Task/AjaxSignIn/',
dataType : 'json',
success : function(data) {
if (data.success || data.msg == "您今天已经签过到啦") {
chrome.runtime.sendMessage({
method: "setLocalStorage", key: "fund123_status", val: today
}, function(res) {});
}
}
});
}
} else {
console.log('[qiandao][fund123] already signIn today.');
}
});
});
}(window, document, Zepto);
9 changes: 7 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "自动签到",
"short_name": "签到",
"version": "0.0.6",
"version": "0.0.7",
"manifest_version": 2,
"description": "访问时如果已登陆则在淘宝,百度贴吧,点评,一号店,苏宁,虾米等网站自动签到",
"description": "访问时如果已登陆则在淘宝,百度贴吧,点评,一号店,苏宁,虾米,微盘,数米基金网等网站自动签到",
"homepage_url": "http://fayland.me/",
"icons": {
"16": "icons/icon16.png",
Expand Down Expand Up @@ -45,6 +45,11 @@
"matches": [ "http://tieba.baidu.com/*" ],
"js": [ "js/zepto.min.js", "js/qiandao/tieba.js" ],
"run_at": "document_end"
},
{
"matches": [ "http://*.fund123.cn/*" ],
"js": [ "js/zepto.min.js", "js/qiandao/fund123.js" ],
"run_at": "document_end"
}
],
"background": {
Expand Down
5 changes: 5 additions & 0 deletions src/browser_action/browser_action.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,10 @@
<td>微盘</td><td id='weipan_status'></td><td id='weipan_points'>-</td>
<td><a href='http://vdisk.weibo.com/' target='_blank'>访问</a></td>
</tr>
<tr>
<td>数米基金网</td><td id='fund123_status'></td><td id='fund123_points'>-</td>
<td><a href='http://i.fund123.cn/' target='_blank'>访问</a></td>
</tr>

</table>
</div>
3 changes: 2 additions & 1 deletion src/browser_action/browser_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
'suning_status', 'suning_points',
'xiami_status',
'tieba_status',
'weipan_status', 'weipan_points'
'weipan_status', 'weipan_points',
'fund123_status'
];
$.each(ele, function(i, v) {
$('#' + v).text(localStorage.getItem(v));
Expand Down

0 comments on commit 025ce36

Please sign in to comment.