Rocksolid Light

Welcome to novaBBS

register   nodelist   faq  

12 Aug, 2020: Temporary authentication problems should be fixed. Was working on account syncing and finished now.


rocksolid / Programming / Re: vichan to do list

SubjectAuthor
* Re: vichan to do listanon
`* Re: vichan to do listanon
 `- Re: vichan to do listMarc SCHAEFER

Subject: Re: vichan to do list
From: ano...@anon.com (anon)
Newsgroups: rocksolid.programming
Organization: def5
Date: Thu, 4 Jun 2020 12:27 UTC

actually, the messages are mime encoded so vichan should be able to parse them if they are sent correctly. that would be the best way imo (to let vichan do the parsing).
if i could just read the code that was used to upload.

Posted on def4


Subject: Re: vichan to do list
From: ano...@anon.com (anon)
Newsgroups: rocksolid.programming
Organization: def5
Date: Thu, 4 Jun 2020 13:22 UTC

i will try that soon. meanwhile, here is what a request to vichans post.php looks like:

POST /post.php HTTP/1.1
Host: xxxxxxxxxxxxxxxx.onion
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://xxxxxxxxxxxxxxxx.onion/ts/index.html
Content-Type: multipart/form-data; boundary=---------------------------234374660515071969761262837861
Content-Length: 16935
Connection: keep-alive
Upgrade-Insecure-Requests: 1

-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="nke73c⛻lgoujxyd8⛆4asvr6wf92ih0t"

♦M+<Q4]#(X7J☳FLzh*q,⛻-x8'⚜☯AHac☀IS
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="q"

M3Ce⚋tv+&hA `!>1j;q
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="board"

ts
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="t82o♁kq5970cs3♠dpujmbwvz"

66873
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="page"

1
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="lastname"


-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="subject"

testing some
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="post"

Post
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="url"

♊TK@!mr2=QM4J:).0I65ny,⛳oWa
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="body"

here is some text
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="text"

2nP.e0mZ_C{,)E?Q>d!1♭b@V|J7<
-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="file"; filename="woman-e1590571316950-380x214.jpg"
Content-Type: image/jpeg

<FF><D8><FF><E0>^@^PJFIF^@^A^A^A^@H^@H^@^@<FF><DB>^@C^@^H^F^F^G^F^E^H^G^G^G            ^L^T^M^L^K^K^L^Y^R^S^O^T^]^Z^_^^^]^Z^\^\ $.' ",#^\^\
|
|cut out the rest here
|

-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="password"


-----------------------------234374660515071969761262837861
Content-Disposition: form-data; name="hash"

9f9927bd6ca11c6b4379c17b9273cab58fadefb3
-----------------------------234374660515071969761262837861--


note all the fields that are disregarded later, just to catch spambots. :-)

if i can rewrite that with php and send it as raw http i think we might be able to use the native post.php of vichan (with some minor adaptions).
but for shortterm, i will try your script soon.

cheers

trw

Posted on def4


Subject: Re: vichan to do list
From: schae...@alphanet.ch (Marc SCHAEFER)
Newsgroups: rocksolid.programming
Organization: Posted through ALPHANET (https://news.alphanet.ch/)
Date: Tue, 9 Jun 2020 11:45 UTC
anon <anon@anon.com> wrote:
POST /post.php HTTP/1.1

In case, you can see JSON from my read-only newsreader here:

https://nnrp.alphanet.ch/newsgroup/rocksolid.programming/%3C8cb53de068f68ce971aa235b44272aab%241%40news.novabbs.com%3E?mode=json

Implementation:

   if ($self->param('mode') eq 'json') {
      my %headers;
  
      my $headers = $a->headers;
      # yeah, not simple re
      #    - to make the loop work, we need to not remove the final \n if any, so we use
      #      a look-ahead: https://stackoverflow.com/questions/3926451/how-to-match-but-not-capture-part-of-a-regex
      #    - we accept continuation lines
      #    - maybe the header re is a bit too strict
      #    - 'rest' should be empty if all was right
      $headers =~ s/(^|\n)([a-zA-Z0-9\-]+):\s?(.*)(\n\s+.*|)(?=\n|$)/$headers{$2} = $3 . $4; ""/eg;
  
      $self->render(json => { 'headers' => \%headers,
                              'body' => $a->body,
                              'headers_raw' => $a->headers,
                              'rest' => $headers
      });
   }


1
rocksolid light 0.6.5f
clearnet i2p tor