-
Notifications
You must be signed in to change notification settings - Fork 18
/
get-AllMyFunctionsFromGitHub.pq
76 lines (76 loc) · 2.75 KB
/
get-AllMyFunctionsFromGitHub.pq
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
let
output =
() as table =>
let
out = Web.Contents("https://github.com/tirnovar/m-custom-functions"),
#"Extracted Table From Html" =
Html.Table(
out,
{
{
"Method",
"TD:nth-child(1)"
},
{
"Name",
"TD:nth-child(2)"
},
{
"Detail",
"TD:nth-child(3)"
},
{
"Language",
"TD:nth-child(4)"
},
{
"Url",
"TD:nth-child(2) > A:nth-child(1):nth-last-child(1)",
each [Attributes][href]?
}
},
[RowSelector = "TBODY TR"]
),
#"Replaced Value" =
Table.ReplaceValue(
#"Extracted Table From Html",
"github.com",
"raw.githubusercontent.com",
Replacer.ReplaceText,
{"Url"}
),
#"Replaced Value1" =
Table.ReplaceValue(
#"Replaced Value",
"/blob",
"",
Replacer.ReplaceText,
{"Url"}
),
#"Added Custom" =
Table.AddColumn(
#"Replaced Value1",
"Function",
each
Expression.Evaluate(
Text.FromBinary(Binary.Buffer(Web.Contents([Url]))),
#shared
)
)
in
#"Added Custom",
documentation = [
Documentation.Name = " get-AllMyFunctionsFromGitHub.pq ",
Documentation.Description = " Add all functions from tirnovar repository m-custom-function into your Power BI ",
Documentation.Source = "https://www.jaknapowerbi.cz . ",
Documentation.Version = " 1.0 ",
Documentation.Author = " Štěpán Rešl "
]
in
Value.ReplaceType(
output,
Value.ReplaceMetadata(
Value.Type(output),
documentation
)
)