I am trying to get a large amount of comments with PRAW in a python Reddit bot. I know that the absolute limit of submissions you can get is 1000, with the default being 100. I use this line of code below to get the comments:
for comment in r.redditor(raw_username).comments.new(limit=None):
As you can see I have set limit=None but I can still only get 100 comments at a time. Why is this? I have looked elsewhere but all the answers I could find were people wanting to go over the 1000 limit. Thanks for any help.
It seems that it still gets limited if used too much. Waiting for a bit fixed it.
Related
I am trying to develop a bot using discord.py that will be able to go through the channel, count how many times a certain word is used, then give me the top X number of users that have said that phrase (in a given timeframe), along with the number of times that they have each said it.
So if I do !bump7, I want it to give me the top, say, 10 users that have said "bump" in the last 7 days
Or !hello10, which would give me the top 10 users that have said "hello" in the last 10 days.
The message would look something like...
Billybob 34 times
Cathrynaloha 27 times
Suzy 3 times
JohnDoe 2 times
I have the bot connected to the discord server, but I can't seem to figure out how to make this particular command work. And unfortunately no, I don't have anything in the works, as I'm just trying to search through here to see if anything similar has been done. So far, not a whole lot has been helpful. So any help on developing the client.command() would be awesome! Thank you!
-
I've actually tried really hard to do something similar to this person here: Discord.py: How to go through channel history and count the occurrences of a phrase?
However, it does not work at all, and I have no idea why. The conversation there is not exactly extensive, so I don't have a whole lot of context to work out anything. So re-opening/reiterating seems beneficial here
I've tried searching other areas in this site (and even a handful of other sites) to see if I can't troubleshoot it myself, but have run into too many walls. Guidance would be awesome.
I was wondering if there is a way to limit the output of an encrypted or hashed value.
The case I have is, that I provide links for customers, having the id to an entry in my db, which contains relevant information for the receiver. Sooo... to avoid accessing to entries which are for someone else I am encrypting the id and append its outcome to the link. Now I am faced with the problem, that those "final links" are extremely long and ugly as f%!# (I actually got a lot responses, that they look highly suspicious and some of the customers didn't clicked on it, because they were afraid of being redirected to a phishing site).
However, this made me think about the option of limiting or individually setting the length of the encryptions outcome, like force it to contain 8 to 16 characters instead of about 250(? not sure how long they actually are). I also want to avoid using something like a redirecting page and a "self-made" URL shortener, because of the extra step I don't need.
Currently I've spent more than two hours of googling and reading several discussions regarding this topic and yeah... I am not satisfied with the results. Most of them started about two years up to five years ago.
What else I did?
I looked into Laravels api, especially into Illuminate\Encryption\Encrypter, but still no solution found.
Sooooo... I hope anyone can help me out with a solution based on laravel. I don't want to use anything else like php_mbcrypt itself than laravels encrypt or Hash::make.
Thanks in advance!
I'm trying to get the hang of Lenskit (quite hard at first). Right now I'm playing around with the hello-lenskit examples, it is working as expected. However, I'd like to go beyond that and when I read the documentation it seems it's not up to date, e.g.,
http://lenskit.org/documentation/basics/configuration/
(many links, such as the one for LenskitRecommenderEngineFactory, ItemItemRatingPredictor lead to page not found)
So, how did you experts get to master lenskit? trial and error? mailing list? here?
Cheers!!
I'm trying to get going with JMeter, and am having trouble finding a really simple tutorial for the first "getting started" the docs seem to be very verbose, covering all kinds of scenarios.
Can anyone point me at something that would take me from having downloaded the app (I can run it, and get a gui) to the point where I can send a single, predefined GET request, at a specific rate.
Just one request, no login, nothing. But I'd like to be able to send it at a selected rate.
This will do two things for me, first, get past that wall of info that I'm finding and give me a starting point from which to experiment. Second, it's actually pretty much all I want to do anyway; I don't want to record results, I just want to hit a server at specific steady state rates, and observe the OS level impact on the server when it stabilizes (number of threads, memory usage, rate of context switching, cpu usage). I'll get to more complex things later, maybe.
I'm sure someone has written something to achieve this, but google keeps finding heavyweight "tomes" that are off-putting to wade through and feel like they're wasting huge amounts of my time :(
(Oh, and I did search here, but only found more complex stuff; hope I didn't get egg on my face with a duplicate!)
TIA,
Toby
I find Blazemeter's JMeter tutorial to be very beginner friendly:
http://community.blazemeter.com/knowledgebase/topics/10018-jmeter-tutorials
http://community.blazemeter.com/knowledgebase/articles/197560-jmeter-video-tutorial-writing-your-first-jmeter-s
(I'm not affiliated with Blazemeter)
The structure of the simplest JMeter Test Plan as per your scenario should be something like:
Thread Group - to set a number of threads and iterations
HTTP Request - to configure endpoint, path, parameters, etc.
Constant Throughput Timer - to set exact desired request execution rate (N requests per second)
Hope this helps.
Gach, as so often is the case, the terminology was obscuring that first level of understanding that allows one to make use of the docs. I found what I needed right there in the regular documentation:
http://jmeter.apache.org/usermanual/build-web-test-plan.html
The feedburner awareness API seemed to be working fine till last night but its not working right now. Its not even down but returning 0 for every site. I wonder if there is something I am missing or have the removed this functionality or something.
https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=http://feeds.feedburner.com/RandomGoodStuff
However if I give dates with feedburner it gives the values.
https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=http://feeds2.feedburner.com/RandomGoodStuff&dates=2008-01-01,2008-04-02
Anyone knows what is going on? I tried looking for any change in the API but didn't find any. Neither could I find a way to ask google about it.
According to the Awareness API documentation, circulation — an approximate measure of the number of individuals for whom your feed has been requested in the 24 hour period described by date. So just add &dates=YYYY-MM-DD, where date is a day before yesterday. This way you will always get the result, fresh and grater than zero.