Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2018-04-13 18:57:39, last edited by IanJanes (2018-04-13 19:00:28)

IanJanes
Member
From: Duluth Minnesota
Joined: 2018-01-05
Posts: 180

Why are people making testing bot topics, or testing the bot in reply?

I've seen these quite useless topics that say something like "testing gregbot", and the newest one being someone testing their own bot. It isn't productive and serves no purpose, so why do it? I don't understand the point of doing it, so would someone please explain? To me right now it sounds like something you'd say to sound cool, or just to sound smart.

Thanks and have fun!
-Gabe newell

Edit: If you want to test your own bot, you could design a forum with FluxBB. I'm not sure how that works, or if at all, but this seems useless to use someone else's forum to do this.


<Download this image and make it your avatar, repent from unique avatars!
3640.jpg?m=15483497583640.jpg?m=15483497583640.jpg?m=1548349758

Offline

#2 2018-04-13 19:20:14, last edited by LukeM (2018-04-13 19:20:31)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: Why are people making testing bot topics, or testing the bot in reply?

Not sure what they are testing exactly (might not be any reason to do it here), but if there was something you needed to test, it would be a lot of effort to set up another testing forum, and there are some things you just wouldnt be able to reproduce, such as gregbot (as im guessing its not open source), and certain features diff has added on top of the default forums (theres no way to know exactly how they work, as yet again not open source)

Offline

Wooted by: (2)

#3 2018-04-13 21:10:34

MartenM
Member
From: The Netherlands
Joined: 2016-03-31
Posts: 966
Website

Re: Why are people making testing bot topics, or testing the bot in reply?

Correct me if I am wrong, but I can only find one topic that mentions anything about testing bots.

But still. Let me explain that one topic there in off-topic.
As the title suggest, it's a topic for testing WatchFull which was made by me for the new EE discord (John was talking about this and how he would do it. I decided to take the challenge my self and that's how Watchful was born). It features about the same functionallities as GregBot on the other EE discord. Due to the nature of the project and the fact that it's been made for this forum escpecially its not really possible to test it on another forum. The only thing I can do is to wait for new posts, which I mostly did but some other people wanted confirmation faster so they created that topic.
Stuff is up and running now so for my part the 'testing Watchful' topic can be closed.

Hope that explains that a bit.
Also what other topics where you talking about? I can only find one :/


lm3hgg8.jpg

Ingame: marten22        My steam: MartenM

Offline

#4 2018-04-13 22:38:11

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,852

Re: Why are people making testing bot topics, or testing the bot in reply?

for future reference, you can make a thread with a topic we can actually discuss AND use it as a test thread! We'd never be the wiser

Offline

Wooted by: (4)

#5 2018-04-13 23:01:02, last edited by MartenM (2018-04-13 23:03:54)

MartenM
Member
From: The Netherlands
Joined: 2016-03-31
Posts: 966
Website

Re: Why are people making testing bot topics, or testing the bot in reply?

Hmm yeah maybe that would have been smarter but it was never my intention to have a test topic at all (And I didn't make one either //forums.everybodyedits.com/img/smilies/wink )

Also:

humhum wrote:

and consider making your bot a bit more transparent as polling certain pages a lot can be annoying and slow things down

Different is aware of the bot. We even discussed how Greg works (probably). He pointed out that Greg at one point made the forums almost crash. Watchful only refreshes (1 page) every minute so it should not too much extra stress on the forum.


lm3hgg8.jpg

Ingame: marten22        My steam: MartenM

Offline

#6 2018-04-13 23:34:14

XxAtillaxX
Member
Joined: 2015-11-28
Posts: 4,202

Re: Why are people making testing bot topics, or testing the bot in reply?

public class EverybodyEditsForums
{
    public List<ForumCategory> Forums { get; set; }

    public EverybodyEditsForums()
    {
        this.Forums = new List<ForumCategory>() {
            new ForumCategory(id:3, title:"Game Business", alias:"GB"),
            new ForumCategory(id:2, title:"Forum Business", alias:"FB"),

            new ForumCategory(id:4, title:"Game Discussion", alias:"GD"),
            new ForumCategory(id:19, title:"Bots and Programming", alias:"B&P"),
            new ForumCategory(id:9, title:"Crews", alias:"Crews"),
            new ForumCategory(id:18, title:"Questions and Answers", alias:"Q&A"),
            new ForumCategory(id:7, title:"Level Creation", alias:"Lvl Create"),
            new ForumCategory(id:8, title:"Rooms", alias:"Rooms"),

            new ForumCategory(id:20, title:"Graphics Suggestions", alias:"Gfx Sug."),
            new ForumCategory(id:5, title:"Game Suggestions", alias:"Game Sug."),
            new ForumCategory(id:24, title:"Campaign Suggestions", alias:"Camp Sug."),
            new ForumCategory(id:11, title:"Forum Discussion", alias:"FD"),
            new ForumCategory(id:12, title:"Bug Reports", alias:"Bugs"),

            new ForumCategory(id:13, title:"Off-Topic Discussion", alias:"Off-Topic"),
            new ForumCategory(id:26, title:"Debates", alias:"Debates"),
            new ForumCategory(id:14, title:"Creative", alias:"Crtv"),
            new ForumCategory(id:17, title:"Forum Games", alias:"FG"),

            new ForumCategory(id:21, title:"Mod Discussion", alias:"MD"),

            new ForumCategory(id:15, title:"Topic Graveyard", alias:"GY"),
        };
    }

    [Serializable()]
    public class ForumFeed
    {
        [XmlRoot(ElementName = "author")]
        public class Author
        {
            [XmlElement(ElementName = "name")]
            public string Name { get; set; }
            [XmlElement(ElementName = "uri")]
            public string Uri { get; set; }
            [XmlElement(ElementName = "email")]
            public string Email { get; set; }
        }

        [XmlRoot(ElementName = "topic"), Serializable()]
        public class Topic
        {
            [XmlElement(ElementName = "title")]
            public string Title { get; set; }
            [XmlElement(ElementName = "link")]
            public string Link { get; set; }
            [XmlElement(ElementName = "content")]
            public string Content { get; set; }
            [XmlElement(ElementName = "author")]
            public Author Author { get; set; }
            [XmlElement(ElementName = "posted")]
            public string Posted { get; set; }
            [XmlAttribute(AttributeName = "id")]
            public string Id { get; set; }
        }

        [XmlRoot(ElementName = "source"), Serializable()]
        public class Source
        {
            [XmlElement(ElementName = "url")]
            public string Url { get; set; }
            [XmlElement(ElementName = "topic")]
            public List<Topic> Topic { get; set; }
        }
    }

    public ForumFeed.Source Refresh(params ForumCategory[] categories)
    {
        var query = new Uri("http://forums.everybodyedits.com/extern.php?type=xml&fid=" + ((categories != null && categories.Length > 0) ? string.Join(",", from cat in categories select cat.Id) : ""));
        var feed = new XmlDocument(); {
            feed.LoadXml(new WebClient() { Proxy = null }.DownloadString(query));
        }

        // remove the header prior to serialization.
        feed.RemoveChild(feed.FirstChild);

        var serializer = new XmlSerializer(typeof(ForumFeed.Source), new XmlRootAttribute("source"));
        var deserialized = (ForumFeed.Source)serializer.Deserialize(new MemoryStream(Encoding.UTF8.GetBytes(feed.InnerXml)));

        return deserialized;
    }

    public class ForumCategory
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public string Alias { get; set; }

        public ForumCategory(int id, string title, string alias)
        {
            this.Id = id;
            this.Title = title;
            this.Alias = alias;
        }
    }
}
this.Forums = new EverybodyEditsForums();

this.ConnectionComplete += (s, e) => {
    this.LastChecked = DateTime.UtcNow;
    
    this.ThreadWatcher = EasyTimer.SetInterval(() => {
        var feed = this.Forums.Refresh();
        var posts = feed.Topic.Where(x => DateTime.Parse(x.Posted).ToUniversalTime() >= this.LastChecked);
        
        foreach (var post in posts) {
            var category = new EverybodyEditsForums.ForumCategory(0, "???", "???");
            
            foreach (var forum in this.Forums.Forums) {
                if (this.Forums.Refresh(forum).Topic.Any(x => x.Id == post.Id)) {
                    category = forum;
                    break;
                }
            }
            
            this.SendMessage($"[{category.Alias}] [{ post.Author.Name }] { Helpers.Truncate(post.Title, 24) }");
       }

        this.LastChecked = DateTime.UtcNow;
    }, 1000 * 10);
};

ayy lmao


signature.png
*u stinky*

Offline

#7 2018-04-13 23:36:57, last edited by MartenM (2018-04-13 23:37:28)

MartenM
Member
From: The Netherlands
Joined: 2016-03-31
Posts: 966
Website

Re: Why are people making testing bot topics, or testing the bot in reply?

XxAtillaxX wrote:
public class EverybodyEditsForums
{
    
};

ayy lmao

I am not sure what you are trying to point out with this?
Who wrote this btw?


lm3hgg8.jpg

Ingame: marten22        My steam: MartenM

Offline

#8 2018-04-14 00:05:10

XxAtillaxX
Member
Joined: 2015-11-28
Posts: 4,202

Re: Why are people making testing bot topics, or testing the bot in reply?

MartenM wrote:

I am not sure what you are trying to point out with this?
Who wrote this btw?

It's just code snippet of the bot I wrote for the (now defunct) #eeforums IRC channel when Greg was down.

I wrote one for Discord in Python too.

import os
import re
import time
import json
import hashlib
import threading
import html2text
import requests
import discord
import asyncio

from datetime import datetime, date
from bs4 import BeautifulSoup as Soup
from bs4 import NavigableString

client = discord.Client()

def strip_html(html):
    soup = Soup(html, "html.parser")
    [div.extract() for div in soup.findAll('div')]
    [span.extract() for span in soup.findAll('span')]
    [br.extract() for br in soup.findAll('br')]

    result = ''

    try:
        result = html2text.html2text(str(soup))
    except:
        result = str(soup)
    re.sub(r'(\r\n){2,}','\r\n', result)

    return result
 
async def parse_forums():
    READ_FORUM_FEED_DELAY = 10
    PREVIOUS_POSTS = []
    FULLY_PARSED = False

    while True:
        req = requests.request('GET', 'http://forums.everybodyedits.com/extern.php?action=feed&type=xml')
        soup = Soup(req.content, "html.parser")

        posts = []
        for message in soup.findAll('topic'):
            post_id = message.attrs['id']
            title = message.find('title').text
            author_name = message.find('author').find('name').text
            author_profile = message.find('author').find('uri').text
            timestamp = datetime.strptime(message.find('posted').text, "%a, %d %b %Y %H:%M:%S +0000")
            content = strip_html(message.find('content').text)
            digest = hashlib.sha1(str.format('{}{}{}', post_id, author_profile, timestamp).encode('utf-8')).hexdigest()
            
            post = { 'post_id': post_id, 'title': title, 'author_name': author_name, 'author_profile': author_profile,
                     'timestamp': timestamp, 'content': content, 'digest': digest }
            posts.append(post)

        if FULLY_PARSED:
            found_posts = []

            for first in posts:
                found = False

                for second in PREVIOUS_POSTS:
                    if first['digest'] == second['digest']:
                        found = True
                        break

                if not found:
                    found_posts.append(first)

            for post in found_posts:
                print(post)
                # do something, (i.e. await client.send_message())

            PREVIOUS_POSTS = posts
        else:
            PREVIOUS_POSTS = posts
            FULLY_PARSED = True
            
        time.sleep(READ_FORUM_FEED_DELAY)

if __name__ == "__main__":
    @client.event
    async def on_ready():
        print('Logged in as')
        print(client.user.name)
        print(client.user.id)
        print('------')

        forum_parse_thread = threading.Thread(target=parse_forums, args=())
        forum_parse_thread.daemon = True
        forum_parse_thread.start()

    client.run('secret_key_goes_here')

:^


signature.png
*u stinky*

Offline

Wooted by:
XxAtillaxX1523660710703042

Board footer

Powered by FluxBB

[ Started around 1711720886.416 - Generated in 0.154 seconds, 12 queries executed - Memory usage: 1.5 MiB (Peak: 1.67 MiB) ]