reddit

Digg-like search result ranking with Lucene / Solr?

别来无恙 提交于 2019-12-06 13:30:01
I'm using Solr for search. I have documents that have an integer field " popularity ". I want to rank results by a combination of normal fulltext search relevance and popularity. It's kinda like search in digg - result ranking is based on the search relevance as well as how many digs a posting has. I don't have any specific ranking algorithm in mind. But is this something that can be done with solr? Solr's FunctionQuery is exactly what you need: http://wiki.apache.org/solr/FunctionQuery 来源: https://stackoverflow.com/questions/1996668/digg-like-search-result-ranking-with-lucene-solr

Help getting URL linked to by Reddit post With PRAW

为君一笑 提交于 2019-12-06 04:24:31
问题 Using Praw I am trying to get the post linked to in the title of a Reddit submission. For example the submission links to this image. I have tried figuring out a way to extract this information from the Submission object in PRAW however even when browsing the source I have not been able to find this information. This seems like something that should be easy so I may be missing something. Thank you very much for your help. 回答1: import praw user_agent = praw.Reddit("my_cool_user_agent") link =

PRAW: Comment Submitter's Username

倾然丶 夕夏残阳落幕 提交于 2019-12-06 03:01:12
问题 I'm developing a reddit bot that needs to know which user submitted a comment. According to the PRAW API wrapper docs, there's no specific way to get the username of a Comment object's author. Ideally I could directly get the username back. If that's not possible, is there a way to get the fullname of the author and then convert it to a username? 回答1: I'm a maintainer for PRAW. Where does it say that you cannot get the username of a Comment objects author? Because that is incorrect and needs

Reddit API returns HTTP 403

夙愿已清 提交于 2019-12-05 13:08:15
Following the OAuth2 login flow described at https://github.com/reddit/reddit/wiki/OAuth2 I got to the point where POST-ing to https://www.reddit.com/api/v1/access_token returns something like this: {'token_type': 'bearer', 'expires_in': 3600, 'scope': 'identity', 'access_token': '*****'} Then I do GET https://oauth.reddit.com/api/v1/me With this header: Authorization: bearer ***** The response is HTTP 403 Unauthorized. But why? It is clear that the access token has 'identity' scope. It is also documented that the /api/v1/me call requires this scope only. (See https://www.reddit.com/dev/api

How does pagination on Reddit's home page work?

▼魔方 西西 提交于 2019-12-05 09:35:39
Reddit uses a time decay algorithm. That would mean the sort order is subject to change. When a user goes to page 2, is there a mechanism to prevent them from seeing a post that was on page 1 but was bumped down to page 2 before they paged over? Is it just an acceptable flaw of the sort method? Or are the first couple of pages cached for the user so this doesn't happen? Side note: It's my understand that Digg cannot suffer from this issue but that HackerNews and Reddit can. From the next URL you see: http://www.reddit.com/?count=25&after=t3_dj7xt So clearly the next page ensures that the page2

How to login using Reddit's API?

情到浓时终转凉″ 提交于 2019-12-05 03:10:26
问题 Am trying to access my Reddit user's account by using the Reddit API - POST login Endpoint listed on its API page. I tried this: curl -i -X POST -d '{"user":"myusername", "passwd":"mypassword", "rem":"true" }' http://www.reddit.com/api/login But it said wrong password (I logged into the website with the same credentials so I don't know what's wrong): HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 { "jquery": [[0, 1, "call", ["body"]], [1, 2, "attr", "find"], [2, 3, "call", ["

Post to Reddit via URL

蹲街弑〆低调 提交于 2019-12-04 17:26:00
问题 Is it possible to post a link to Reddit via URL? For example for Facebook you can do <a href="https://www.facebook.com/sharer/sharer.php?u=http://stackoverflow.com"> Share Stackoverflow on your profile! </a> Does Reddit have an equivalent endpoint I can hit to share a URL? 回答1: There are several ways to do this, depending on exactly what kind of application you have. If you're making something interactive, you can take a user to the submit page with a URL and title already filled in. The

PRAW: Comment Submitter's Username

帅比萌擦擦* 提交于 2019-12-04 08:00:31
I'm developing a reddit bot that needs to know which user submitted a comment. According to the PRAW API wrapper docs, there's no specific way to get the username of a Comment object's author. Ideally I could directly get the username back. If that's not possible, is there a way to get the fullname of the author and then convert it to a username? I'm a maintainer for PRAW. Where does it say that you cannot get the username of a Comment objects author? Because that is incorrect and needs to be fixed. Anyway, a Comment has a author attribute, which is a Redditor instance of the author. import

Get all comments from a specific reddit thread in python

谁都会走 提交于 2019-12-03 16:42:42
问题 The official way, r = praw.Reddit('Comment Scraper 1.0 by u/_Daimon_ see ' 'https://praw.readthedocs.org/en/latest/' 'pages/comment_parsing.html') submission = r.get_submission(submission_id='11v36o') submission.replace_more_comments(limit=None, threshold=0) is extremely slow. Is there a way to speed this up? There are people that have extracted every reddit comment into a database, so there must be some way to do this quicker. 回答1: Edit: the new praw api (6.0.0) has lists() which make the

How to login using Reddit's API?

℡╲_俬逩灬. 提交于 2019-12-03 16:24:34
Am trying to access my Reddit user's account by using the Reddit API - POST login Endpoint listed on its API page. I tried this: curl -i -X POST -d '{"user":"myusername", "passwd":"mypassword", "rem":"true" }' http://www.reddit.com/api/login But it said wrong password (I logged into the website with the same credentials so I don't know what's wrong): HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 { "jquery": [[0, 1, "call", ["body"]], [1, 2, "attr", "find"], [2, 3, "call", [".status"]], [3, 4, "attr", "hide"], [4, 5, "call", []], [5, 6, "attr", "html"], [6, 7, "call", [""]], [7,