This is an automated email generated because a ref change occurred in the
git repository for project duojsonparge.git.
The branch, master has been updated
       via  cddebac1083f6d55da75a5742081f6504b883c7e (commit)
      from  0fe4c85858e66746cf5cba0881f7b19b4224c377 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cddebac1083f6d55da75a5742081f6504b883c7e
Author: hahahahacker2009 <
hahahaha...@gmail.com>
Date:   Fri, 11 Jul 2025 21:52:53 +0700
URL:    <
https://repo.or.cz/duojsonparge.git/cddebac1083f6d55>
    script to import duo json to spamdforum
    
---
 import_spamdforum.php | 64 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 import_spamdforum.php
diff --git a/import_spamdforum.php b/import_spamdforum.php
new file mode 100644
index 000000000000..595e87bf8492
--- /dev/null
+++ b/import_spamdforum.php
@@ -0,0 +1,64 @@
+<?php
+$start = hrtime(true);
+//
https://repo.or.cz/spamdforum.git/blob/HEAD:/extra/dbconnect.php
+require_once(__DIR__ . '/dbconnect.php');
+$files = scandir(__DIR__ . '/comments/', SCANDIR_SORT_NONE);
+$files = array_diff($files, array('..', '.'));
+natsort($files);
+foreach($files as $key => $fn) {
+	$data = json_decode(file_get_contents(__DIR__ . "/comments/$fn"), true);
+	$title = $data['title'];
+	$topic = sprintf("duo%d", $data['topic']['id']);
+	if (!isset($data['user']['deactivated'])) {
+		if ($data['user']['mod'] == true)
+			$user = "\"{$data['user']['username']}\"@
duolingo.com!mod";
+		else if ($data['user']['admin'] == true)
+			$user = "\"{$data['user']['username']}\"@
duolingo.com!admin";
+		else
+			$user = "\"{$data['user']['username']}\"@
duolingo.com";
+	} else {
+		$user = "\"deactivated\"@
duolingo.com!deactivated";}
+	$datetime = date("Y-m-d H:i:s", strtotime($data['datetime_string'])+25200);
+	$cmt = array($data['id'], 0, $title, $data['message'], $user, $topic, $data['votes'], 100, 100, $datetime, $datetime);
+	newmsg($cmt, 0);
+	walk_cmt($data['comments'], $data['id']);
+}
+?>
+
+<?php
+function walk_cmt($cmtarr, $relate) {
+	global $title, $topic;
+	$i = -1;
+	$cmt = array();
+	foreach ($cmtarr as $key => $arr) {
+		if (!isset($arr['user']['deactivated'])) {
+			if ($arr['user']['mod'] == true)
+				$user = "\"{$arr['user']['username']}\"@
duolingo.com!mod";
+			else if ($arr['user']['admin'] == true)
+				$user = "\"{$arr['user']['username']}\"@
duolingo.com!admin";
+			else
+				$user = "\"{$arr['user']['username']}\"@
duolingo.com";
+		} else {
+			$user = "\"deactivated\"@
duolingo.com!deactivated";
+		}
+		$datetime = date("Y-m-d H:i:s", strtotime($arr['datetime_string'])+25200);
+		$cmt = array_merge($cmt, array($arr['id'], $relate, $title, $arr['message'], $user, $topic, $arr['votes'], 100, 100, $datetime, $datetime));
+		walk_cmt($arr['comments'], $arr['id']);
+		$i++;
+	}
+	if ($i > -1)
+		newmsg($cmt, $i);
+}
+function newmsg($arr, $nval) {
+	global $dbc;
+	$query = "INSERT INTO forum_msg (msg_id, relate_to, subject, body, from_addr, to_addr, votes, "
+		    . "r_pwlvl, w_pwlvl, last_edit, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
+		    . str_repeat(",(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $nval);
+	if (mysqli_execute_query($dbc, $query, $arr))
+		return mysqli_insert_id($dbc);
+	else
+		return FALSE;
+}
+$end = hrtime(true);
+echo ($end - $start)/1000000 . "ms";
+?>
-----------------------------------------------------------------------
Summary of changes:
 import_spamdforum.php | 64 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 import_spamdforum.php
repo.or.cz automatic notification. Contact project admin 
hahahaha...@gmail.com
if you want to unsubscribe, or site admin 
ad...@repo.or.cz if you receive
no reply.
-- 
duojsonparge.git ("Scripts to parse duolingo forum's json file and generate minimal HTML web page.")