Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8257483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:12:45+00:00 2026-06-08T02:12:45+00:00

In reddit URL, there is 5 characternumerics thing_id part (for example, wplf7 from http://redd.it/wplf7)

  • 0

In reddit URL, there is “5 characternumerics” thing_id part (for example, “wplf7” from “http://redd.it/wplf7”) which is generated by base36.

wplf7 is generated from number 54941875 – this is what I found so far… I’m wondering how 54941875 is generated.

I’m trying to scrape comment of a reddit’s specific section (let’s say http://www.reddit.com/r/leagueoflegends/) using R and I’m stuck at this 5 character numerics.

Anyone who can explain this in the simple manner? Unfortunately Python is not my domain and 2000 lines of python code listed on Reddit’s website didn’t help me much.

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:12:47+00:00Added an answer on June 8, 2026 at 2:12 am

    Firstly set an uniqueish user agent as reddit likes this

    options(HTTPUserAgent="My name is BOB")
    

    I assumme you want to get the content at http://www.reddit.com/r/leagueoflegends/ . You need to append a .json to the url:

    library(RJSONIO)
    library(RCurl)
    # library(XML)
    
    jdata<-getURL('http://www.reddit.com/r/leagueoflegends/.json')
    jdata<-fromJSON(jdata)
    # xdata<-getURL('http://www.reddit.com/r/leagueoflegends/.xml')
    # xdata<-xmlParse(xdata)
    

    Obviously the content is very rich for example the domains,permalinks,authors, titles of posts:

    Domains<-sapply(jdata[[2]]$children,function(x){x$data$domain})
    permalinks<-sapply(jdata[[2]]$children,function(x){x$data$permalink})
    authors<-sapply(jdata[[2]]$children,function(x){x$data$author})
    titles<-sapply(jdata[[2]]$children,function(x){x$data$title})
    ids<-sapply(jdata[[2]]$children,function(x){x$data$id})
    created<-as.POSIXct(sapply(jdata[[2]]$children,function(x){x$data$created}),origin="1970/01/01")
    
    
    > head(titles)
    [1] "Pendragon 3-day-banning someone for randoming in ranked, or saying hes going to. Mixed feelings..."
    [2] "Dig Kicks L0cust."                                                                                 
    [3] "Summoners, y u no communicate??"                                                                   
    [4] "Without Even Trying"                                                                               
    [5] "Cross Country Tryndamere (Chaox Stream)"                                                           
    [6] "Top 5 Flops - Episode 4 ft Dyrus, Phantoml0rd, and HatPerson vs Baron Nashor"                      
    > 
    

    To investigate how these ids are generated we can apply @Ben Bolker s base36ToInteger function to the ids we have gathered and compare them against the date they were created giving:

    createData<-data.frame(created=created,ids=sapply(ids,base36ToInteger))
    > dput(createData)
    structure(list(created = structure(c(1342658844, 1342657298, 
    1342622962, 1342643655, 1342641187, 1342654768, 1342665353, 1342640599, 
    1342648272, 1342662822, 1342654185, 1342659591, 1342624350, 1342647907, 
    1342637587, 1342591960, 1342625515, 1342642330, 1342651384, 1342668363, 
    1342608976, 1342608165, 1342632545, 1342638611, 1342643489), class = c("POSIXct", 
    "POSIXt")), ids = c(55047001, 55044612, 55010018, 55025557, 55022809, 
    55040754, 55056689, 55022221, 55031424, 55053023, 55039810, 55048123, 
    55010880, 55030934, 55019343, 54976515, 55011555, 55024060, 55035670, 
    55061120, 54998192, 54997264, 55015528, 55020295, 55025363)), .Names = c("created", 
    "ids"), row.names = c("wrujd", "wrsp0", "wr202", "wrdzp", "wrbvd", 
    "wrppu", "ws20h", "wrbf1", "wriio", "wrz6n", "wrozm", "wrvej", 
    "wr2o0", "wri52", "wr973", "wqc5f", "wr36r", "wrcu4", "wrlsm", 
    "ws5fk", "wqsvk", "wqs5s", "wr694", "wr9xj", "wrdub"), class = "data.frame")
    

    enter image description here

    which implies that reddit generates these numbers sequentially across the site as new posts are created.

    Without a specific direction I will leave it at this but hopefully you get the idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a Yahoo! Pipe to pull an RSS feed from Reddit which links
I am trying to get the score for a certain URL from reddit. To
Simply put I want what http://www.reddit.com/ and http://news.ycombinator.com/ have to the left of every
Accordng to https://github.com/reddit/reddit/wiki/API I need to: Post the following to http://www.reddit.com/api/submit : uh=f0f0f0f0&kind=link&url=yourlink.com&sr=funny &title=omg-look-at-this&id%23newlink&r=funny&renderstyle=html
Is it even possible to get JSON feed from Reddit and post it in
On reddit, I've seen a link to web site, which does not only interpret
I have a bunch of these: 'link' => http://twitter.com/home?status=Check out &quot;{title}&quot; {url}, And Want
According to http://www.reddit.com/r/programming/comments/gwqa2/the_real_point_of_laziness/c1rslxk Some algorithms don't terminate in an eager language, that do in
I've been trying to build a little bot which will be using Reddit's API.
I'm trying to make a reddit-like web application from scratch. I'm not sure how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.