-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.rpaf
58 lines (43 loc) · 1.31 KB
/
main.rpaf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
# @author: Dimitrov Blagoi
#
import IO
import ALGO
import DOCX
import WEB
print running...
var page_filename := const index.html
var traverse_tags := const @html@body@div!3@div!3@div!4@div@table!DAY@tbody@tr@td@div@div
var info_tags := concat %traverse_tags @div
var image_tags := concat %traverse_tags @a@img
open_new_document
var year := const 2019
var month := const 1
var base_url := const https://ru.wikipedia.org/wiki/Шаблон:Potd/YEAR-MONTH
var year_url := replace %base_url YEAR %year
loop 12
get_month_name %month
add_title %_
print %_
new_page
format_length %month 2 0
var url := replace %year_url MONTH %_
load_page %url
print_to_file %page_filename %_
var day := const 1
days_count_by_month %year %month
loop %_
replace %info_tags DAY %day
var image_info := get_element_from_html %page_filename %_ field text
replace %image_tags DAY %day
var image_url := get_element_from_html %page_filename %_ attr src
add_image_by_url %image_url
new_paragraph
add_text %image_info
new_page
day := inc %day
endloop
month := inc %month
endloop
save_hard_as test.docx
print finished.