Skip to content

Commit 4bb76fd

Browse files
committed
Merge branch 'master' of git://github.com/hkegbert/ICS
Conflicts: api/CORE/core php/UIcache/cache.html
2 parents 4803eea + bce83dc commit 4bb76fd

File tree

5 files changed

+146
-48
lines changed

5 files changed

+146
-48
lines changed

Install.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ for i in `ls api`; do
77
make;)
88
done
99

10-
#crontab -l > tmp_1
11-
#echo '
12-
#PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin
13-
#ICSHOME=`pwd`/api
14-
#ICSDATA=`pwd`/data
15-
#* * * * * cd $ICSHOME/CORE; ./core' > tmp_2
10+
crontab -l > tmp_1
11+
echo "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin
12+
ICSHOME=`pwd`/api
13+
ICSDATA=`pwd`/data
14+
* * * * * cd -P \$ICSHOME/CORE; ./core" >> tmp_1
15+
crontab tmp_1 && rm tmp_1
16+
17+
echo "Install Success!"

api/CORE/core

-12.2 KB
Binary file not shown.

api/CORE/core.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ void deal_content(char (*content)[MAXLINE],int* line,DIR* dp,struct dirent* dirp
5858
if(option=='='){
5959
fscanf(fptr,") ");
6060
continue;
61+
}else if(option=='-' && fgetc(fptr)==')'){
62+
fseek(fptr,-1,SEEK_CUR);
63+
fscanf(fptr,") ");
64+
continue;
6165
}
6266
//get time format
6367
if(strcmp(buffer,"RSS")==0){
@@ -103,6 +107,8 @@ void deal_content(char (*content)[MAXLINE],int* line,DIR* dp,struct dirent* dirp
103107
case YOU:
104108
strcat(cmd,"./youtube ");
105109
fscanf(fptr,"[search] => %s ",buffer);
110+
if(strcmp(buffer,")")==0)
111+
continue;
106112
strcat(cmd,"\"");
107113
strcat(cmd,buffer);
108114
strcat(cmd,"\" ");
@@ -113,6 +119,8 @@ void deal_content(char (*content)[MAXLINE],int* line,DIR* dp,struct dirent* dirp
113119
fscanf(fptr,"[cmd] => ");
114120
strcpy(buffer,"(");
115121
fgets(buffer+1,MAXLINE,fptr);
122+
if(strcmp(buffer,"()\n")==0)
123+
continue;
116124
buffer[strlen(buffer)-1] = ')';
117125
buffer[strlen(buffer)] = '\0';
118126
fscanf(fptr," ");
@@ -122,6 +130,8 @@ void deal_content(char (*content)[MAXLINE],int* line,DIR* dp,struct dirent* dirp
122130
case RSS:
123131
strcat(cmd,"./rss ");
124132
fscanf(fptr,"[url] => %s ",buffer);
133+
if(strcmp(buffer,")")==0)
134+
continue;
125135
strcat(cmd,"\"");
126136
strcat(cmd,buffer);
127137
strcat(cmd,"\" ");
@@ -149,6 +159,17 @@ void deal_content(char (*content)[MAXLINE],int* line,DIR* dp,struct dirent* dirp
149159
}
150160
break;
151161
case '!': // modify
162+
for(i=1;i<(*line);i++){
163+
if(sscanf(content[i],"#ICS task id = %s, comment ",buffer)){
164+
buffer[strlen(buffer)-1]='\0';
165+
if(strcmp(buffer,id)==0){
166+
content[i][0] = content[i+1][0] = '\0';
167+
snprintf(content[(*line)++],MAXLINE,"#ICS task id = %s, comment\n",id);
168+
strcpy(content[(*line)++],cmd);
169+
break;
170+
}
171+
}
172+
}
152173
break;
153174
default:
154175
err_quit("unkown option");

api/CORE/task

Lines changed: 117 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,137 @@
11
Array
22
(
3-
[Task1234657897] => Array
3+
[Task1245523666] => Array
4+
(
5+
[type] => CMD
6+
[id] => 1245523666
7+
[op] => -
8+
)
9+
10+
[Task1245523667] => Array
11+
(
12+
[type] => RSS
13+
[id] => 1245523667
14+
[op] => -
15+
)
16+
17+
[Task1245523668] => Array
18+
(
19+
[type] => CMD
20+
[id] => 1245523668
21+
[op] => -
22+
)
23+
24+
[Task1245523669] => Array
25+
(
26+
[type] => RSS
27+
[id] => 1245523669
28+
[op] => -
29+
)
30+
31+
[Task1245523670] => Array
32+
(
33+
[type] => CMD
34+
[id] => 1245523670
35+
[op] => -
36+
)
37+
38+
[Task1245523671] => Array
439
(
540
[type] => RSS
6-
[id] => 13246767897
41+
[id] => 1245523671
42+
[op] => -
43+
)
44+
45+
[Task1245523672] => Array
46+
(
47+
[type] => CMD
48+
[id] => 1245523672
49+
[op] => -
50+
[month] => *
51+
[day] => *
52+
[week] => *
53+
[hour] => *
54+
[minute] => *
55+
[cmd] => dcdc
56+
)
57+
58+
[Task1245523673] => Array
59+
(
60+
[type] => CMD
61+
[id] => 1245523673
62+
[op] => +
63+
[month] => *
64+
[day] => *
65+
[week] => *
66+
[hour] => *
67+
[minute] => *
68+
[cmd] =>
69+
)
70+
71+
[Task1245523674] => Array
72+
(
73+
[type] => RSS
74+
[id] => 1245523674
775
[op] => +
876
[circle] => */30 * * * *
9-
[url] => fghjhe(*^lkb23gf
77+
[url] => iluil
1078
)
11-
[Task1234687657] => Array
79+
80+
[Task1245523675] => Array
1281
(
1382
[type] => CMD
14-
[id] => 123457897
83+
[id] => 1245523675
1584
[op] => +
1685
[month] => *
1786
[day] => *
1887
[week] => *
1988
[hour] => *
2089
[minute] => *
21-
[cmd] => ls > QQ
90+
[cmd] =>
2291
)
23-
[Task1234657897] => Array
92+
93+
[Task1245523676] => Array
2494
(
25-
[type] => YOU
26-
[id] => 132456756
95+
[type] => RSS
96+
[id] => 1245523676
2797
[op] => +
28-
[search] => texxxxt+2009-06-17&aq=f
98+
[circle] => */30 * * * *
99+
[url] =>
29100
)
30-
)
31101

102+
[Task1245523677] => Array
103+
(
104+
[type] => CMD
105+
[id] => 1245523677
106+
[op] => +
107+
[month] => *
108+
[day] => *
109+
[week] => *
110+
[hour] => *
111+
[minute] => *
112+
[cmd] => io;oi;
113+
)
114+
115+
[Task1245523678] => Array
116+
(
117+
[type] => RSS
118+
[id] => 1245523678
119+
[op] => +
120+
[circle] => */30 * * * *
121+
[url] =>
122+
)
123+
124+
[Task1245523679] => Array
125+
(
126+
[type] => CMD
127+
[id] => 1245523679
128+
[op] => +
129+
[month] => *
130+
[day] => *
131+
[week] => *
132+
[hour] => *
133+
[minute] => *
134+
[cmd] =>
135+
)
136+
137+
)

api/CORE/task2

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)