Based on the demo recent_questions.py example, I am using the following code to retrieve the 10 most recent questions at the command line:
so = stackexchange.Site(stackexchange.StackOverflow)
questions = so.recent_questions(pagesize=10)
for q in questions:
print "question retrieved:", q.title.encode('ascii', 'ignore'), "\t", q.id
...
As you can see I am displaying the title
and id
attributes of each question object.
My question has 2 parts:
- How can I get a list of attributes to each method (such as recent_questions)? I simply guessed correctly that
id
would work, but it does not seem to be listed when I refer to>>> help(stackexchange)
- I would like to extend my script to 'star' (mark as 'favourite') some questions that grab my interest. Is this a reasonable prospect? Is there a method/attribute for this, and in which class? Most importantly, is authentication even possible via the API? This would presumably be necessary in order to 'star' questions.