added crawling for web reciever
fixed crawling settings condition
This commit is contained in:
parent
20fb4ed76a
commit
b2974b7501
2
poll.go
2
poll.go
@ -186,7 +186,7 @@ func PollMastodonPleroma(endpoint string, o *RunningInstance) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only done if we are crawling
|
// Only done if we are crawling
|
||||||
if settings.Crawl == true && stringexists(endpoint, settings.Banned) == false {
|
if settings.Crawl == true && stringexists(newinstance, settings.Banned) == false {
|
||||||
// Skip over this if its the same as the endpoint
|
// Skip over this if its the same as the endpoint
|
||||||
if newinstance == endpoint {
|
if newinstance == endpoint {
|
||||||
continue
|
continue
|
||||||
|
@ -98,7 +98,7 @@ func StreamMastodon(endpoint string, o *RunningInstance) {
|
|||||||
at_sign := strings.Index(newpost.Account.Acct, "@")
|
at_sign := strings.Index(newpost.Account.Acct, "@")
|
||||||
newinstance := newpost.Account.Acct[at_sign+1:]
|
newinstance := newpost.Account.Acct[at_sign+1:]
|
||||||
|
|
||||||
if settings.Crawl == true && stringexists(endpoint, settings.Banned) == false {
|
if settings.Crawl == true && stringexists(newinstance, settings.Banned) == false {
|
||||||
ri_mutex.Lock()
|
ri_mutex.Lock()
|
||||||
o, exists := runninginstances[newinstance]
|
o, exists := runninginstances[newinstance]
|
||||||
if exists == false || o.Status == KEEPALIVE {
|
if exists == false || o.Status == KEEPALIVE {
|
||||||
|
21
web.go
21
web.go
@ -9,7 +9,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
// "strings"
|
"strings"
|
||||||
// "time"
|
// "time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -118,6 +118,25 @@ func inboxHandler() http.HandlerFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
go check_post(createobject.ID)
|
go check_post(createobject.ID)
|
||||||
|
slashend := strings.Index(createobject.ID[8:], "/")
|
||||||
|
newinstance := createobject.ID[8:8+slashend]
|
||||||
|
log.Print("The at sign is: ", newinstance)
|
||||||
|
|
||||||
|
// Only done if we are crawling
|
||||||
|
if settings.Crawl == true && stringexists(newinstance, settings.Banned) == false {
|
||||||
|
// Skip over this if its the same as the endpoint
|
||||||
|
ri_mutex.Lock()
|
||||||
|
o, exists := runninginstances[newinstance]
|
||||||
|
if exists == false || o.Status == KEEPALIVE {
|
||||||
|
m := RunningInstance{}
|
||||||
|
runninginstances[newinstance] = m
|
||||||
|
go StartInstance(newinstance)
|
||||||
|
}
|
||||||
|
|
||||||
|
ri_mutex.Unlock()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
case "Like":
|
case "Like":
|
||||||
case "Announcement":
|
case "Announcement":
|
||||||
case "Delete":
|
case "Delete":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user