this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix another parser issue; add seperation for formatting

nnuuvv 1e17a680 b55c28fc

+9 -7
+9 -7
src/condition_overload.gleam
··· 21 21 "https://wiki.warframe.com/w/Condition_Overload_%28Mechanic%29?action=edit&section=7", 22 22 "https://wiki.warframe.com/w/Condition_Overload_%28Mechanic%29?action=edit&section=8", 23 23 ] 24 - |> list.map(get_page_data) 24 + |> list.map(get_gun_page_data) 25 25 |> promise.await_list() 26 26 |> promise.map(result.values) 27 27 |> promise.map(list.flatten) ··· 40 40 _ -> { 41 41 rows 42 42 |> list.take(4) 43 - |> list.map(fn(x) { io.println(format_row(x)) }) 44 - Nil 43 + |> list.map(fn(x) { format_row(x) }) 44 + |> list.reduce(fn(acc, x) { acc <> " || " <> x }) 45 + |> result.map(io.println) 46 + |> result.unwrap_both() 45 47 } 46 48 } 47 49 }) ··· 85 87 ) = row 86 88 87 89 let name = 88 - list.first(names) 90 + list.reduce(names, fn(acc, x) { acc <> " / " <> x }) 89 91 |> result.unwrap("") 90 92 91 93 "The '" ··· 94 96 <> attack 95 97 <> "' attack has a " 96 98 <> rating 97 - <> " interaction with GunCO" 99 + <> " interaction with GunCO." 98 100 } 99 101 100 102 // do request and return Row if successful 101 103 // 102 - fn get_page_data( 104 + fn get_gun_page_data( 103 105 url: String, 104 106 ) -> promise.Promise(Result(List(Row), fetch.FetchError)) { 105 107 let assert Ok(req) = request.to(url) ··· 256 258 // parse the weapon names 257 259 // 258 260 fn parse_names(line: String, acc) { 259 - let sep = splitter.new(["}}/{{Weapon|", "}}/{{Weapon", "}}||", "}}"]) 261 + let sep = splitter.new(["}}/{{Weapon|", "}}"]) 260 262 261 263 let #(name, split_by, rest) = splitter.split(sep, line) 262 264