summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsijanec <anton@sijanec.eu>2021-06-10 22:46:51 +0200
committersijanec <anton@sijanec.eu>2021-06-10 22:46:51 +0200
commit7dc77c36d73efece554577001dfe4140c19db46e (patch)
treea44535afe25d3a7a4e33bd7e6c2ae787e6237da0
parentUTF-8, image support, memory leaks fixed (diff)
downloadsear.c-7dc77c36d73efece554577001dfe4140c19db46e.tar
sear.c-7dc77c36d73efece554577001dfe4140c19db46e.tar.gz
sear.c-7dc77c36d73efece554577001dfe4140c19db46e.tar.bz2
sear.c-7dc77c36d73efece554577001dfe4140c19db46e.tar.lz
sear.c-7dc77c36d73efece554577001dfe4140c19db46e.tar.xz
sear.c-7dc77c36d73efece554577001dfe4140c19db46e.tar.zst
sear.c-7dc77c36d73efece554577001dfe4140c19db46e.zip
-rw-r--r--src/api.c5
-rw-r--r--src/hp.html3
-rw-r--r--src/lib.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/api.c b/src/api.c
index 9a9bbc8..709e2e2 100644
--- a/src/api.c
+++ b/src/api.c
@@ -174,6 +174,7 @@ struct sc_query * sc_query_google (const char * s, struct sc_cache * c, struct s
rs = -2;
goto rc;
}
+ /* TODO: check if response is asking for a captcha */
if (opt & SC_OPT_IMAGE) {
imageclass = sc_find_class(txtdoc, "{font-family:Roboto,Helvetica,Arial,sans-serif}");
if (!imageclass) {
@@ -185,7 +186,7 @@ struct sc_query * sc_query_google (const char * s, struct sc_cache * c, struct s
titleclass = sc_find_class(txtdoc, "{color:#1967D2;font-size:14px;line-height:16px}");
descclass = sc_find_class(txtdoc, "{word-break:break-word}");
if (!titleclass || !descclass) {
- SC_LOG(SC_LOG_ERROR, c, "!titleclass || !descclass");
+ SC_LOG(SC_LOG_ERROR, c, "!titleclass || !descclass, txtdoc = %s", txtdoc);
rs = -4;
goto rc;
}
@@ -218,7 +219,7 @@ struct sc_query * sc_query_google (const char * s, struct sc_cache * c, struct s
SC_LOG(SC_LOG_DEBUG, c, "hreflink = %s", hreflink);
sscanf(hreflink, "/imgres?imgurl=%m[^&]&imgrefurl=%m[^&]", &imgurl, &imgrefurl);
if (!imgurl && !imgrefurl) {
- SC_LOG(SC_LOG_ERROR, c, "!imgurl && !imgrefurl");
+ SC_LOG(SC_LOG_ERROR, c, "!imgurl && !imgrefurl, txtdoc = %s", txtdoc);
/* rs = -6; */ /* we continue running not fail because of a single picture */
free(imgurl);
free(imgrefurl);
diff --git a/src/hp.html b/src/hp.html
index 6bb15db..7d1307b 100644
--- a/src/hp.html
+++ b/src/hp.html
@@ -61,6 +61,9 @@
.result img {
height: 10em;
}
+ .result img:hover {
+ height: 20em; /* biggah pictah onah hovrah */
+ }
</style>
</head>
<body>
diff --git a/src/lib.c b/src/lib.c
index 8659431..2377ec9 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -83,7 +83,7 @@ void printNode (xmlNodePtr node, void * data) {
}
#define gnu_code_start \
_Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wpedantic\"")
+ _Pragma ("GCC diagnostic ignored \"-Wpedantic\"") \
_Pragma ("GCC diagnostic ignored \"-Wformat=\"")
#define gnu_code_end \
_Pragma ("GCC diagnostic pop")