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
59
60
61
// UG-Scraper - A basic rust API for getting data from Ultimate Guitar
// Copyright (C) 2025 Linus Tibert
//
// This program was originally published under the MIT licence as seen
// here: https://github.com/Lich-Corals/ug-tab-scraper-rs/blob/mistress/LICENCE
use decode_html_entities;
use ;
use ;
/// Returns the raw HTML of a given URL wraped in an Result.
///
/// ## Example:
/// ```
/// use ug_scraper::network::get_raw_html;
///
/// let raw_html: String = get_raw_html("https://tabs.ultimate-guitar.com/tab/rick-astley/never-gonna-give-you-up-chords-521741").unwrap();
/// ```
///
/// ## Possible errors
/// * `ureq::Error::*`
/// Returns a String with common escaped characters unescaped.
///
/// ## Example:
/// ```
/// use ug_scraper::network::unescape_string;
///
/// let escaped_string: &str = "This\\t is a tab.";
/// let clean_string: String = unescape_string(escaped_string);
/// // Returns:
/// // "This is a tab"
/// ```
/// Applies basic encoding for use as an argument for a URL
///
/// ## Example:
/// ```
/// use ug_scraper::network::encode_string;
///
/// let encoded_string: String = encode_string("This is an example & \"");
/// // Returns:
/// // "This%20is%20an%20example%20&%20""
/// ```