Yahoo! search interface: Difference between revisions
Content added Content deleted
Jazzedpineda (talk | contribs) (Omitted EasyLang) |
m (→{{header|Wren}}: Minor tidy) |
||
Line 3,022: | Line 3,022: | ||
A somewhat ''ad hoc'' solution as the output format for Yahoo! search seems to change quite frequently. All I can say is that this worked on 5th January, 2022. |
A somewhat ''ad hoc'' solution as the output format for Yahoo! search seems to change quite frequently. All I can say is that this worked on 5th January, 2022. |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="wren">/* Yahoo_search_interface.wren */ |
||
import "./pattern" for Pattern |
import "./pattern" for Pattern |
||
Line 3,110: | Line 3,110: | ||
<br> |
<br> |
||
We now embed this script in the following C program, build and run. |
We now embed this script in the following C program, build and run. |
||
<syntaxhighlight lang="c">/* gcc |
<syntaxhighlight lang="c">/* gcc Yahoo_search_interface.c -o Yahoo_search_interface -lcurl -lwren -lm */ |
||
#include <stdio.h> |
#include <stdio.h> |
||
Line 3,284: | Line 3,284: | ||
WrenVM* vm = wrenNewVM(&config); |
WrenVM* vm = wrenNewVM(&config); |
||
const char* module = "main"; |
const char* module = "main"; |
||
const char* fileName = " |
const char* fileName = "Yahoo_search_interface.wren"; |
||
char *script = readFile(fileName); |
char *script = readFile(fileName); |
||
WrenInterpretResult result = wrenInterpret(vm, module, script); |
WrenInterpretResult result = wrenInterpret(vm, module, script); |