Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Featrue] Delete original items from Pocket #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cmd/pocket2notion/pocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ func retrievePocketItems(config *config.Project, args arguments) ([]api.Item, er

sort.Sort(bySortID(items))

if args.pocketDeleteOrg {
for _, item := range items {
delAct := &api.Action {
Action: "delete",
ItemID: item.ItemID,
}
client.Modify(delAct)
}
}

return items, nil
}

Expand Down
2 changes: 2 additions & 0 deletions cmd/pocket2notion/pocket2notion.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type arguments struct {
pocketTagFilter string
pocketSearchFilter string
pocketSinceFilter int
pocketDeleteOrg bool

notionTags bool
notionBatchSize int
Expand All @@ -45,6 +46,7 @@ func main() {
flag.StringVar(&args.pocketTagFilter, "tag", "", "Only import Pocket items matching with tag")
flag.StringVar(&args.pocketSearchFilter, "search", "", "Only import Pocket items matching with search")
flag.IntVar(&args.pocketSinceFilter, "since", 0, "Only import Pocket items since a timestamp")
flag.BoolVar(&args.pocketDeleteOrg, "delete", false, "Delete original in Pocket")

flag.IntVar(&args.notionBatchSize, "notion-batch", 5, "Import into Notion by batch of <n> per http call")
flag.BoolVar(&args.notionTags, "notion-tags", true, "Append Pocket tags to Notion by appending them to the item title with a hashtag")
Expand Down