Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
add search result special case (#17)
Browse files Browse the repository at this point in the history
* add search result special case

search results were not deleting - there is a secondary
confirmation page which wasn't being handled.

* address pr comments
  • Loading branch information
charlesangus authored May 3, 2021
1 parent 841467a commit f4bd236
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion deleter.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var categoriesMap = map[string]string{
"Spotify": "genericapp&category_app_id=174829003346",
}

var tokensInURLs = [...]string{"/removecontent", "/delete", "/report", "/events/remove.php", "&content_type=4&"}
var tokensInURLs = [...]string{"/removecontent", "/delete", "/report", "/events/remove.php", "&content_type=4&", "action=delete"}

type requester struct {
client *http.Client
Expand Down Expand Up @@ -452,6 +452,20 @@ func (del *deleter) DeleteCoverOrProfilePhoto(elem *deleteElement) {
elem.success = true
}

func (del *deleter) DeleteSearch(elem *deleteElement) {

out := del.req.Request(elem.URL)

from, to := getURLFromToString(out, "/allactivity/delete/")
if from == -1 {
return
}
del_url := facebookURL + out[from:to]
out = del.req.Request(del_url)
elem.success = true

}

func (del *deleter) DeleteElement(elem *deleteElement) {
defer func() {
if e := recover(); e != nil {
Expand All @@ -468,6 +482,8 @@ func (del *deleter) DeleteElement(elem *deleteElement) {
if elem.category == "Photos and Videos" {
del.DeleteCoverOrProfilePhoto(elem)
}
} else if elem.token == "action=delete" {
del.DeleteSearch(elem)
} else {
del.req.Request(elem.URL)
elem.success = true
Expand Down

0 comments on commit f4bd236

Please sign in to comment.