4
retoor
4d

Some people wanted to download their rants / comments. I'm working on it.

Three lines of native python code (no dependencies) to see what @Lensflare said:

from pprint import pp
from xmlrpc.client import ServerProxy
pp(ServerProxy("https://victoria.molodetz.nl/rpc").get_comments({'id':{'gt':42},'_limit':1337,'username':'Lensflare'}))

I think this gives example of possibilities enough. Use your fantasy on how to retrieve rants.

Limitations:
- Not whole dR is available yet, but way more than retrievable using the public dR API. This system uses the user website as source.
- It doesn't show rant_id or comment_id and it won't to prevent abuse. Later today, there will be away to attach rants comments.
- maximum 2500 record limit. But soon you can get comments for every rant per user. You won't reach this limit in normal usage

Have fun with it! Don't worry about the abusing the API. Everything is allowed. It's fast as F. If it doesn't respond - it wasn't you. I work on it and often reboot services and it takes some time to recover to state.

If you're not familiar with python, that's ok. Check if you're a decent dev and have python or python3 on your computer. Just execute it and paste the lines. Other way is to save these three limes to a file ending with .py and execute python3 [your-file].

Another example for people not used to python:
from pprint import pprint as pp # nice printing of values
client = ServerProxy("https://victoria.molodetz.nl/rpc")
comments = client.get_comments({'_limit':1337})
for comment in comments:
if comment.get('username','default username') == 'kiki':
print(comment.get('body'))
pp(comment)

Happy hacking!

Comments
  • 2
    This is a micro python tutorial for people new to the language. It's written to show some python features. I hope this helps.

    Tabs or spaces doesn't matter guys! If using spaces, it must be a multiple of two.

    This code will show every comment where Lensflare is doing a mention to someone:

    Challenge: do filter mentions using the get_comments parameters. Use your imagination.
  • 1
    @retoor cool! Why import pprint if it's not being used?
  • 1
    Nice work!
  • 2
    @ScriptCoded fack, yeah was too fast. The first example image even has a syntax error.

    But besides that, I kinda like my examples, it's quite a microtutorial :) With this info, you can query and display yourself as someone not knowing python I guess :)
  • 1
    @retoor: Holy fuck.

    This has worked very nicely on 1st try.

    _Awesome_ tutorial.

    /* I finally got around installing python && trying this out. */
Add Comment