Порядочная сволочь с мерзким характером (lord_baskervil) wrote in lj_dev,

API for communities

Hello. I want to get more info about communities via API, but I found only names in profile responce. Does exist api for getting information about community, such as amount of members, your priveleges in this community and etc?
Tags: *unanswered, client, client: communities
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 6 comments

pauamma

June 22 2012, 11:18:34 UTC 2 years ago

You can get some of what you want from the FOAF page for the community. See eg, http://lj-dev.livejournal.com/data/foaf

tortoises

June 22 2012, 12:57:23 UTC 2 years ago

Would you happen to know if there's a simple way to get a list of members for a community? Sorry for piggybacking on the OP's post, but it seemed relevant! :)

pauamma

June 22 2012, 13:20:14 UTC 2 years ago

Short useless answer #1: yes (I happen to know)
Short useless answer #2: yes (there is a way)
Short, useful answer: visit the link to the lj_dev FOAF page in my comment upthread
Less short, perhaps more useful answer: The FOAF page for the comm has that info, and it's XML, so it can be parsed with a standard or 3rd-party library in most languages.

tortoises

June 22 2012, 13:27:33 UTC 2 years ago Edited:  June 22 2012, 13:27:50 UTC

Haha, sorry for wording the question that way. Thanks for the reply; I did look at the FOAF page you linked prior to asking the question, but it doesn't seem to give me all the members, unfortunately. (For pkmncollectors, this page tells me there's 4317 members, but grepping "<foaf:member>" on the XML page only gives me 913 lines.)

pauamma

June 22 2012, 13:59:10 UTC 2 years ago

*nod* Looked at http://www.livejournal.com/support/faqbrowse.bml?faqid=149, and it looks like the OPML page may give you what you want even for communities with a lot of members:

wget -O - 'http://www.livejournal.com/tools/opml.bml?user=pkmncollectors' | grep "outline text" | wc -l
--2012-06-22 15:53:54-- http://www.livejournal.com/tools/opml.bml?user=pkmncollectors
Resolving www.livejournal.com... 208.93.0.128
Connecting to www.livejournal.com|208.93.0.128|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 359433 (351K) [text/plain]
Saving to: `STDOUT'

100%[======================================>] 359,433 44.6K/s in 7.8s

2012-06-22 15:54:04 (45.1 KB/s) - written to stdout [359433/359433]

4317

tortoises

June 22 2012, 14:02:04 UTC 2 years ago

Thank you, that looks like exactly what I needed! :)