add systemd service files
collect configiguration together update README
This commit is contained in:
43
facebook.go
43
facebook.go
@@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"html"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -17,48 +16,6 @@ import (
|
||||
"mvdan.cc/xurls/v2"
|
||||
)
|
||||
|
||||
// xPath constants
|
||||
const (
|
||||
xPathArticle string = `(//*/article[contains(concat(" ", normalize-space(@class)," "), " _55wo ") and contains(concat(" ", normalize-space(@class)," "), " _5rgr ")])[1]`
|
||||
xPathArticleContent string = xPathArticle + `/div/div[contains(concat(" ", normalize-space(@class)," "), " _5rgt ") and contains(concat(" ", normalize-space(@class)," "), " _5nk5 ")]/span`
|
||||
xPathImageURL string = xPathArticle + `/div/div[2]/div[1]/a/div/div/i`
|
||||
xPathImageURL2 string = xPathArticle + `/div/div[2]/section/div/i`
|
||||
xPathImageURL3 string = xPathArticle + `/div/div[2]/section/div/div/i` // Video Preview
|
||||
xPathGiftURL string = xPathArticle + `/div/div[2]/section/a`
|
||||
xPathPostingURL string = xPathArticle + `/div/header/div[2]/div/div/div[1]/div/a`
|
||||
)
|
||||
|
||||
// internal URL constants
|
||||
const (
|
||||
fbPageURL string = "https://www.facebook.com/herowarsgame/"
|
||||
webhookLive string = "https://discordapp.com/api/webhooks/..."
|
||||
webhookLiveExcelsior string = "https://discordapp.com/api/webhooks/..."
|
||||
webhookDev string = "https://discordapp.com/api/webhooks/..."
|
||||
|
||||
// fbGameURL for search on expaned urls
|
||||
fbGameURL string = "apps.facebook.com/mobaheroes"
|
||||
)
|
||||
|
||||
var (
|
||||
dataFT *DataFT
|
||||
|
||||
lastUpdatePosted string
|
||||
regexStyleImage = regexp.MustCompile(`(?m)url\((.*)\);`)
|
||||
)
|
||||
|
||||
// Constants for all search for title of the Postings
|
||||
const (
|
||||
FreeTitanArtifact string = "FREE Titan Artifact"
|
||||
FreeSilverCaskets string = "FREE Silver Caskets"
|
||||
FreeSoulStones string = "Soul Stones"
|
||||
FreeSkinStones string = "Skin Stones"
|
||||
ActionKeepTheAmount string = "Keep the amount"
|
||||
FreeWinterfestBaubles string = "Winterfest Baubles"
|
||||
FreeTopFanPackage string = "Top Fan"
|
||||
FreeEnergyForFee string = "ENERGY FOR FREE"
|
||||
WinterfestRankingRewards string = "Winterfest ranking rewards"
|
||||
)
|
||||
|
||||
//FBPostData FBPostData
|
||||
type FBPostData struct {
|
||||
PostURL string
|
||||
|
||||
Reference in New Issue
Block a user