summary refs log tree commit diff stats
path: root/draco.pl
Commit message (Collapse)AuthorAgeFilesLines
* Remove created_utc property from each commentAndinus2020-11-251-4/+3
| | | | | It was already included but some people might need the raw value so we include that too. It's included in brackets after parsed value.
* Keep each dot in a single lineAndinus2020-11-251-4/+12
| | | | | It could put a lot of dots, each in new line which makes reading previous debug messages hard.
* Put author name in code block if it begins & ends with "_"Andinus2020-11-251-8/+18
| | | | | If the author name starts & ends with "_" then Org will underline it, so we put those names in a code block.
* Bump version to v0.3.0, add update News to README v0.3.0Andinus2020-11-241-2/+2
|
* Move repeated code to a subroutine, remove some debug messagesAndinus2020-11-241-43/+34
|
* Actually handle all the commentsAndinus2020-11-241-33/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will handle all the comments now! I've explained the change in comments but I'll paste it here too: The problem here is that if the thread is too large then at the end reddit will include similar block in which it'll put all other top-level comments in children of 2nd kind. "kind": "more", "data": { "id": "gde31fk", ... "children": [ "gde31fk", "gdbrnyd", ... If the "load more comments" only hides a single thread then it's the only one included in "children". Note how the "id" & first element of "children" is same. So, reddit wants us to check for the length of this list "children", if it is greater than 1 then we need to pull those comments independently. If not then we just have
* Handle comments hidden under "continue this thread"Andinus2020-11-241-18/+59
| | | | | | | Now Draco prints all comments except top-level comments hidden under "load more comments". I forgot to check for those kind of comments.
* Bump version to v0.2.2 v0.2.2Andinus2020-11-241-1/+1
|
* Handle all kinds of comments in iterate_over_commentsAndinus2020-11-241-80/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iterate_over_comments() is a sub to handle all comments. print_comment_chain() can only parse first kind of comments now, i.e. top-level comments & their replies. Comments hidden under "load more comments" & "continue this thread" require other operations before print_comment_chain() can print them. All those operations are handled by iterate_over_comments(). Currently "continue this thread" is skipped but "load more comments" is parsed. This doesn't add anything to previous releases but just changes the structure. I'm just preparing to add code to parse comments hidden under "continue this thread". After that Draco will be able to archive the whole thread. Previously handling this would've required copying the same code over 3 times, now it'll be handled at one place. 3 times would've been: 1. when we start iterating over top-level comments. 2. when comments hidden under "load more comments" are parsed & their child is hidden under "continue this thread". 3. when replies of normal comments are hidden under "continue this thread". Case 1 & 2 is fixed by switching to iterate_over_comments(). For third, the replies are handled by iterate_over_comments() so the 3rd case is also fixed.
* Update instructions in README, add comments in draco.pl, fix bug v0.2.1Andinus2020-11-241-16/+30
| | | | | | | | | | | | | | | | | $comment in print_comment_chain() was changed to $comment_data to prevent confusion in future. We have to check if url has "/" at the end because if it does have it then previously we were appending "$comment_data->{id}.json" to it which makes the url look like: http://<reddit>/<post_id>//<comment_id>.json And reddit doesn't like that, reddit wants it to be: http://<reddit>/<post_id>/<comment_id>.json Notice the double '/' in previous link.
* Release v0.2.0, load comments hidden under "load more comments"Andinus2020-11-231-13/+111
| | | | | | | | | This version makes the script lot more complex. This version will load all those comments hidden behind "load more comments". But not those hidden behind "continue this thread". Starting this release we have a News section.
* Add "[S]" after submitter's commentsAndinus2020-11-201-1/+3
|
* Add debug option, bump version to v0.1.3 v0.1.3Andinus2020-11-201-3/+6
|
* Include the archive date in propertiesAndinus2020-11-191-0/+2
|
* Bump version to v0.1.2 v0.1.2Andinus2020-11-191-1/+1
|
* Link the post title to urlAndinus2020-11-191-4/+3
|
* Add date to the documentAndinus2020-11-191-0/+7
|
* Add option to print version, bump version to v0.1.1Andinus2020-11-191-3/+12
|
* Switch to Unicode::LineBreak from Text::WrapperAndinus2020-11-191-5/+8
| | | | Unicode::LineBreak seems better.
* Wrap text at 72 characters & put a space before each lineAndinus2020-11-191-2/+16
| | | | | | Space before each line was done because some text may contain `*' at the start of line which confuses Org & it presents that as a new heading. Inserting a space before every new line fixes this.
* Initial commitAndinus2020-11-191-0/+81