summaryrefslogtreecommitdiffstats
path: root/mentions
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-11-09 20:43:37 +0100
committersijanec <sijanecantonluka@gmail.com>2020-11-09 20:43:37 +0100
commita357032d3280256e2f4ea7cd31e0a32bdb8e36ae (patch)
tree0836f00759de3b05937db12eba64d6a299d9e515 /mentions
parentdodal worddetect za pozigalca ampak ni narejen do konca (diff)
downloadoldredditclient-a357032d3280256e2f4ea7cd31e0a32bdb8e36ae.tar
oldredditclient-a357032d3280256e2f4ea7cd31e0a32bdb8e36ae.tar.gz
oldredditclient-a357032d3280256e2f4ea7cd31e0a32bdb8e36ae.tar.bz2
oldredditclient-a357032d3280256e2f4ea7cd31e0a32bdb8e36ae.tar.lz
oldredditclient-a357032d3280256e2f4ea7cd31e0a32bdb8e36ae.tar.xz
oldredditclient-a357032d3280256e2f4ea7cd31e0a32bdb8e36ae.tar.zst
oldredditclient-a357032d3280256e2f4ea7cd31e0a32bdb8e36ae.zip
Diffstat (limited to '')
-rwxr-xr-xmentions/mentions.php2
-rwxr-xr-xmentions/worddetect.php38
2 files changed, 1 insertions, 39 deletions
diff --git a/mentions/mentions.php b/mentions/mentions.php
index c3d095b..8969063 100755
--- a/mentions/mentions.php
+++ b/mentions/mentions.php
@@ -6,7 +6,7 @@
$o->setpassword(getenv("orC_pass"));
$botsignature = "\n\n-- [/u/ImgLinkBot](/u/ImgLinkBot)";
while (true) {
- $mentions = $o->fetch("mentions");
+ $mentions = $o->fetch("mentions", null, 1); // increase to 100!
if ($mentions < 0) {
file_put_contents("log.txt", '[mentions.php] ERROR in $mentions'."\n", FILE_APPEND);
continue;
diff --git a/mentions/worddetect.php b/mentions/worddetect.php
deleted file mode 100755
index 9e63526..0000000
--- a/mentions/worddetect.php
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env php
-<?php
- require_once("../main.php");
- $o = new oldredditClient();
- $o->setusername(getenv("orC_user"));
- $o->setpassword(getenv("orC_pass"));
- $botsignature = "\n\n-- [/u/PozigalecBot](/u/PozigalecBot)";
- while (true) {
- $comments = $o->fetch("comments");
- if ($comments < 0) {
- file_put_contents("log.txt", '[worddetect.php] ERROR in $comments'."\n", FILE_APPEND);
- continue;
- }
- foreach($comment["data"]["children"] as $comment) {
- $processed = file_get_contents("processed.txt");
- if ($processed === false) {
- file_put_contents("log.txt", "[worddetect.php] ERROR: can't read processed.txt\n", FILE_APPEND);
- continue;
- }
- if (in_array($comment["data"]["id"], explode("\n", $processed))) {
- continue;
- }
- if (in_array($comment["data"]["subreddit"], explode("\n", file_get_contents("banned_subs.txt")))) {
- continue;
- }
- if (in_array($comment"data"]["author"], explode("\n", file_get_contents("banned_users.txt")))) {
- continue;
- }
- $parent = "t1_".$comment["data"]["id"];
- if (!file_put_contents("processed.txt", $comment["data"]["id"]."\n", FILE_APPEND)) {
- file_put_contents("log.txt", "[worddetect.php] ERROR mentions_processed.txt PUT\n", FILE_APPEND);
- continue;
- }
- $o->comment("Pa je zašvicu ful! $botsignature", $parent); // TODO!
- }
- sleep(10);
- }
-?>