Visualize Reddit upvotes by subreddit

这是我reddit上所有的upvote在各个subreddit上的分布情况,这个情况还是可以说明我是个普通青年。
Reddit upvotes visualization

排在前几位的分别是

  • Programming
  • Linux
  • Python
  • f7u12
  • Clojure
  • Ubuntu

如果你还不了解什么是Reddit:Reddit是一个巨大的社会书签+论坛网站,他的频道叫做subreddit,每个频道有一个相应的主题,涵盖了从IT技术到新闻到生活的各个角落。

这些数据是通过下面的Clojure程序获得(使用reddit.clj库),并通过jfreechart展现出来的。

Voting with your reddit account on RageViewer

I just implemented a new feature on RageViewer which has been requested for a long time. Now you can login with your Reddit account and up-vote/down-vote rages without turning to Reddit website.

Again, I made a rage comic for this feature.
voting rage

To be able to vote items with your Reddit account, a Reddit session is maintained in the memory of RageViewer. Rage Viewer is a pure open source software so it will never store or log your password in any form. You can verify the source code on github if you have concern about the privacy. (Currently, Reddit doesn’t offer any authorization like OAuth so we can only access your reddit account with your password. Sorry for that.)

For those still have no idea about RageViewer. RageViewer is for browsing rage comics smoothly. It loads most recent comics from fffffffuuuuuuuuuuuu and some other subreddits into the database. It gives you a modern and clean UI for your best experience.

Also important, RageViewer is a full-stack clojure web application that written in the JVM functional language: Clojure(server-side) and ClojureScript(broser-side).

BTW, a new version of Reddit.clj (0.3.0) is available in clojars repository. (the new RageViewer is also based on it). In 0.3.0, reddit.clj is compatible with Clojure 1.3.0. And a “enhance” function is removed that you are no long required to “enhance” a reddit client before you write data to Reddit. Now you have read-write permission once you create the client with reddit.clj.core/login .

Reddit.clj: clojure wrapper for Reddit API

As mentioned in Rage Viewer, I have another clojure library to communicate with Reddit. Now it’s public available as “reddit.clj“.

Reddit.clj is managed with leiningen. The current reddit.clj release is 0.1.3 0.2.0. You can include it in your project.clj:

(defproject xxxx "1.0.0-SNAPSHOT"
  :dependencies [[reddit.clj "0.2.0"]])

This is a simple tutorial for you to getting started :

;; include reddit.clj
(require '[reddit.clj.core :as reddit])
;; create a reddit client with reddit/login.
;; you can also ignore the arguments to use it
;; anonymously
(def rc (reddit/login "your-reddit-name" "your-reddit-passwd"))

;; load reddits from subreddit "clojure", and print titles
(doseq
 [title (map :title (reddit/reddits rc "clojure"))]
  (println title))

;; enhance reddit client to enable writing, for login user only
;; this operation will retrieve reddit user modhash under the hood
(def rc (reddit/enhance rc))

;; vote-up a thing on reddit
(reddit/vote-up rc "t3_iz61z")

;; you may also submit links to reddit.
;; permalink will be returned when success.
;; be careful to use this API because reddit may ask you for a
;; captcha. But as a library, reddit.clj will return nil on this case.
;; use it at your own risk.
(reddit/submit-link rc "title" "url" "subreddit-name")

Detailed API documents are listed here.

This library should be useful to crawl data from reddit which is rich of information. Reddit.clj is hosted on github.

Checkout my forked version of reddit-is-fun

每天上下班要花掉两个多小时,这一路只好浏览一些新闻、reddit以及HN。reddit的app相对来说不算多,找了一圈倒是在market里没找到的reddit-is-fun最好用,功能最全。HN的app最近添加的一个小功能非常实用,通过viewtext.org打开链接。使用这个服务,可以提取出页面的正文部分,既减少了流量又提高了阅读体验。于是我想到给reddit-is-fun添加这个功能。reddit-is-fun是个GPLv3的软件,程序本身就在github上,对Android一无所知的我花了两个小时完成了这个功能。感谢IDEA,感谢IDEA的Android插件。

给作者发了pull request,不过作者最近似乎没有什么实质性的动作。不等他了,今天先把包含这个功能的fork放出来,大家如果感兴趣可以下载安装。这个fork的版本为1.1.4-sunng0,应该不会影响未来升级的吧(我猜啊)。

可以通过这个码下载:
https://github.com/downloads/sunng87/reddit-is-fun/reddit_is_fun-sunng-fork.apk

链接地址:
https://github.com/downloads/sunng87/reddit-is-fun/reddit_is_fun-sunng-fork.apk