词达人小工具2.0 开放源码 C/Python
使用前请阅读注意事项 还是老样子,工具连接: 配置Fidder:教程已更新: 参考第一版使用方法
额外注意事项
if(oSession.uriContains("https://wap.vocabgo.com/Student/ClassTask/SubmitAnswer")){
oSession.utilDecodeResponse();
oSession.SaveResponseBody("C:/responseBody.txt");
}
if(oSession.uriContains("https://wap.vocabgo.com/Student/StudyTask/SubmitAnswer")){
oSession.utilDecodeResponse();
oSession.SaveResponseBody("C:/responseBody.txt");
}
词达人小工具2.0新特性
满足自学任务使用 答案显示优化 源码开放提供大家学习(一代为C,2.0为Python)(文章末尾)
代码运行截图(左为1.0)
源码C/Python
C - 词达人小工具1.0
#include<stdio.h>
#include <stdlib.h>
#include <string.h>
#include<windows.h>
#define MAX_BUFFER 1024 //缓冲区大下
#define BIT 2
/**
** time:2020年3月29日 13:16:36
** author:江浒一只猫
** describe:自动搜索词达人答案,仅供学习参考使用,任何人不得将此用于商用
*/
int main() {
static char answer[9] = ""answer"";
static char answer_arr[11] = "answer_arr";
static char answer_content[15] = "answer_content";
static char Ture[BIT] = "t";
long answersite;
char buff[BIT],answerbuff[MAX_BUFFER/BIT], answer_arrbuff[MAX_BUFFER/BIT];
int answerlite;
FILE *fp; /*文件指针*/
while(1) {
answerlite = 0;
answersite = 0;
//if((fp = fopen("D:\responseBody.txt","r")) == NULL) {
if((fp = fopen("C:\responseBody.txt","r")) == NULL) {
perror("读取资源失败!请检查配置!
");
Sleep(1000);
exit (0) ;
}
//}
//寻找答案
while(fgets(buff, BIT, (FILE*)fp) != NULL) {
//printf("%s", b);
answersite = ftell(fp);
fgets(answerbuff, 9, (FILE*)fp);
//遇到答案标识
if(strcmp(answerbuff, answer) == 0) {
//第几个答案
answerlite ++;
//answersite = ftell(fp);
//取出答案
fgets(buff, BIT, (FILE*)fp);
fgets(buff, BIT, (FILE*)fp);
//答案是否正确
if(strcmp(buff, Ture) == 0) {
//答案正确 则输出答案索引
printf("%d
", answerlite);
}
}
fseek(fp, answersite, 0);
fgets(answerbuff, 11, (FILE*)fp);
if(strcmp(answerbuff, answer_arr) == 0){
fgets(buff, BIT, (FILE*)fp);fgets(buff, BIT, (FILE*)fp);fgets(buff, BIT, (FILE*)fp);
while(fgets(buff, BIT, (FILE*)fp) != NULL && strcmp(buff, "]")){
printf("%s", buff);
}
}
fseek(fp, answersite, 0);
fgets(answerbuff, 15, (FILE*)fp);
if(strcmp(answerbuff, answer_content) == 0){
fgets(buff, BIT, (FILE*)fp);fgets(buff, BIT, (FILE*)fp);fgets(buff, BIT, (FILE*)fp);
while(fgets(buff, BIT, (FILE*)fp) != NULL && strcmp(buff, """)){
printf("%s", buff);
}
}
fseek(fp, answersite, 0);
}
answerlite = 0;
printf("
----------------------
");
if ( fp != NULL ) {
fclose(fp);
}
Sleep(500);
}
return 0;
}
Python - 词达人小工具2.0