-
Notifications
You must be signed in to change notification settings - Fork 10
/
isurl.go
35 lines (28 loc) · 943 Bytes
/
isurl.go
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
package instago
import (
"regexp"
)
func IsWebStoryUrl(url string) bool {
re := regexp.MustCompile(`^https:\/\/www\.instagram\.com\/stories\/[a-zA-Z\d_.]+\/\d+\/$`)
return re.MatchString(url)
}
func IsWebRootUrl(url string) bool {
re := regexp.MustCompile(`^https:\/\/www\.instagram\.com\/$`)
return re.MatchString(url)
}
func IsWebUserUrl(url string) bool {
re := regexp.MustCompile(`^https:\/\/www\.instagram\.com\/[a-zA-Z\d_.]+\/$`)
return re.MatchString(url)
}
func IsWebSavedUrl(url string) bool {
re := regexp.MustCompile(`^https:\/\/www\.instagram\.com\/[a-zA-Z\d_.]+\/saved/all-posts/$`)
return re.MatchString(url)
}
func IsWebTaggedUrl(url string) bool {
re := regexp.MustCompile(`^https:\/\/www\.instagram\.com\/[a-zA-Z\d_.]+\/tagged/$`)
return re.MatchString(url)
}
func IsWebPostUrl(url string) bool {
re := regexp.MustCompile(`^https:\/\/www\.instagram\.com\/p\/[a-zA-Z\d_-]+\/$`)
return re.MatchString(url)
}