Created
April 29, 2011 11:47
-
-
Save kaineer/948198 to your computer and use it in GitHub Desktop.
Пример конфигурации, как оно может выглядеть
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== config/queries.yml | |
output_encoding: cp1251 # utf-8, cp866 etc. | |
input_encoding: cp1251 | |
query_sources: | |
google: # name for query engine | |
base: "http://news.google.com/news/search?pz=1&cf=all&ned=ru_ru&hl=ru&q=%s" | |
stories: | |
css: "#search-stories .story" | |
title: | |
required: true # По умолчанию заголовок обязателен, сниппет - нет, источник - да. Всё, что не подходит, просто игнорируется | |
css: "h2.title .titletext" | |
get: "text, strip" | |
snippet: | |
required: false | |
css: ".body .snippet" | |
get: "text, strip" | |
source: | |
required: true | |
css: ".thumbnail .source a" | |
get: "@href" | |
queries: # А вот тут пойдут запросы | |
source_directory: /home/zelgadis/query-news/queries/ # А тут будут лежать файлы со списками запросов |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment