Cookie Thread Act 6: Cookie & Thread

I’m a steel type now

1 Like

you’ll need at the bare minimum a way to make HTTP requests and a way to parse the returned documents to find the values you need. depending on your programming language of choice, you will probably be able to do everything with a web scraping library, and if a suitable one doesn’t exist, a lower level HTTP request library will do the job (albeit requiring more parsing code to be written by you).

If you don’t have an existing preference, use Python lol

1 Like

Arete gonna get banned rip

1 Like

it’s specifically NOT a Discourse forum

3 Likes

The most “obnoxious” language I can think of for this would be Perl. Perl is known for its dense syntax and sometimes cryptic code, which makes it notorious in certain coding communities. Here’s how you can scrape a Discourse forum using Perl:

Perl Example Using LWP::UserAgent and JSON:

use strict;
use warnings;
use LWP::UserAgent;
use JSON;

# Create a user agent object
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;

# Base URL of the Discourse forum
my $base_url = 'https://forum.example.com';

# Get categories
my $categories_url = "$base_url/categories.json";
my $response = $ua->get($categories_url);

if ($response->is_success) {
    my $categories_data = decode_json($response->decoded_content);
    my $categories = $categories_data->{category_list}->{categories};

    foreach my $category (@$categories) {
        my $category_id = $category->{id};
        my $category_name = $category->{name};

        print "Category: $category_name (ID: $category_id)\n";

        # Get topics for the current category
        my $topics_url = "$base_url/c/$category_id/l/latest.json";
        my $topics_response = $ua->get($topics_url);

        if ($topics_response->is_success) {
            my $topics_data = decode_json($topics_response->decoded_content);
            my $topics = $topics_data->{topic_list}->{topics};

            foreach my $topic (@$topics) {
                my $topic_id = $topic->{id};
                my $topic_title = $topic->{title};

                print "  Topic: $topic_title (ID: $topic_id)\n";

                # Get posts in the topic
                my $posts_url = "$base_url/t/$topic_id.json";
                my $posts_response = $ua->get($posts_url);

                if ($posts_response->is_success) {
                    my $posts_data = decode_json($posts_response->decoded_content);
                    my $posts = $posts_data->{post_stream}->{posts};

                    foreach my $post (@$posts) {
                        my $post_id = $post->{id};
                        my $post_content = $post->{cooked};

                        print "    Post ID: $post_id, Content: $post_content\n";
                    }
                } else {
                    print "Failed to get posts for topic $topic_id\n";
                }
            }
        } else {
            print "Failed to get topics for category $category_id\n";
        }
    }
} else {
    print "Failed to get categories\n";
}

Why this is “Obnoxious”:

  1. Perl’s Syntax: Perl’s syntax is notorious for being terse and difficult to read, especially with its frequent use of special characters (like $, @, %) to denote variable types.
  2. Manual Error Checking: Every API call needs its own is_success check, and if not, the errors tend to be cryptic and hard to debug.
  3. Nested Data Structures: Parsing JSON and handling Perl’s complex data structures (e.g., arrays of hash references) can be difficult, especially for someone unfamiliar with the language.
  4. Verbose: Perl can be overly verbose for simple tasks like HTTP requests and JSON parsing, but this example keeps it minimally obnoxious while still annoying.

Despite Perl’s quirks, it’s still powerful and gets the job done. Would you like to try this out?

1 Like

i cant lie the monotony of doing nothing but Making classes that Do nothing for 3 weeks is getting to me i want to do anything remotely interesting. like at all. what if i made classes that did anything ever

…are you using ChatGPT

3 Likes

What gave it away?

2 Likes

I know nothing about coding scrappers

1 Like

ive been going so insane ive been working on power point presentations for floating point and stack vs heap because im so fucking bored

because Perl is only the most obnoxious language if you’re giving semi-serious answers. Brainfuck would clearly be more obnoxious taken to the absurd. Perl would actually be pretty good language for a web scraper if you got over the syntax because it’s specialty is like text parsing and manipulation lol

2 Likes

that and like everything about the post

1 Like

one second i know of one more obnoxious

1 Like

is it the language that’s purely emojis?

1 Like

I can’t believe the formatting of a Chatgpt post gave it away along with me typing on mobile and somehow posting a gigantic wall of step by step instructions and notes

1 Like

its both clearly not written by you and not great advice

1 Like

it was a few years back so that’s maybe correct

1 Like

I CANT FIND IT IM SO MAD
someone made this absolutely fucked up language influenced by basic in the 80s. it is fascinating in that it is completely earnest yet across the board terrible at everything it tries to do

2 Likes

i didnt even realize chomps was bionic

I think the weirdest language made with complete sincerity I know of is Holy C for TempleOS