<commit_before>#include "parse.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

char *error_data(char *msg);
char *stradd(char *from,char *sub);
int object_stradd(char **res,char *str,char *key,json_object *obj);

char *youku_parse(char *str)
{
	char *res=NULL;
	json_object *obj;
	json_object *item;

	obj=json_tokener_parse(str);
	if(obj == NULL)
		return error_data("返回了错误的数据");
	obj=json_object_array_get_idx(obj,0);
	if(obj == NULL)
		return error_data("返回了错误的数据");

	item=json_object_object_get(obj,"title");
	res=stradd(NULL,json_object_get_string(item));
	json_object_put(item);

	res=stradd(res," <--");
	item=json_object_object_get(obj,"url");
	res=stradd(res,json_object_get_string(item));
	json_object_put(item);

	json_object_put(obj);

	return res;
}

char *google_parse(char *str)
{
	char *res=NULL;
	json_object *obj;
	json_object *item;

	obj=json_tokener_parse(str);
	if(obj == NULL)
		return error_data("返回了错误的数据!");
	obj=json_object_object_get(obj,"items");
	if(obj == NULL)
		return error_data("啊哦，查询出错了哦!");

	obj=json_object_array_get_idx(obj,0);
	if(obj == NULL)
		return error_data("啊哦，查询出错了哦!");
	item=json_object_object_get(obj,"title");
	if(item == NULL)
		return error_data("啊哦，查询出错了哦!");
	res=stradd(res,json_object_get_string(item));<commit_msg>更新错误提示<commit_after>#include "parse.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

char *error_data(char *msg);
char *stradd(char *from,char *sub);
int object_stradd(char **res,char *str,char *key,json_object *obj);

char *youku_parse(char *str)
{
	char *res=NULL;
	json_object *obj;
	json_object *item;

	obj=json_tokener_parse(str);
	if(obj == NULL)
		return error_data("返回了错误的数据");
	obj=json_object_array_get_idx(obj,0);
	if(obj == NULL)
		return error_data("返回了错误的数据");

	item=json_object_object_get(obj,"title");
	res=stradd(NULL,json_object_get_string(item));
	json_object_put(item);

	res=stradd(res," <--");
	item=json_object_object_get(obj,"url");
	res=stradd(res,json_object_get_string(item));
	json_object_put(item);

	json_object_put(obj);

	return res;
}

char *google_parse(char *str)
{
	char *res=NULL;
	json_object *obj;
	json_object *item;

	obj=json_tokener_parse(str);
	if(obj == NULL)
		return error_data("返回了错误的数据!");
	obj=json_object_object_get(obj,"items");
	if(obj == NULL)
		return error_data("啊哦，查询出错了哦!(可能是当日使用量已过百，请明日再试，具体事宜请联系brisk)");

	obj=json_object_array_get_idx(obj,0);
	if(obj == NULL)
		return error_data("啊哦，查询出错了哦!");
	item=json_object_object_get(obj,"title");
	if(item == NULL)
		return error_data("啊哦，查询出错了哦!");
	res=stradd(res,json_object_get_string(item));
{'fraction_non_alphanumeric': 0.16660268714011517, 'fraction_numerical': 0.0015355086372360845, 'mean_word_length': 7.9553264604811, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4562398', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1167, 'n_words': 159}