Created
October 21, 2012 19:09
-
-
Save h4/3928121 to your computer and use it in GitHub Desktop.
Работа с gdocs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from flask import Flask | |
import gdata.docs.service | |
import gdata.spreadsheet.service | |
app = Flask(__name__) | |
def getRegistrationsCount(): | |
client = gdata.spreadsheet.service.SpreadsheetsService() | |
client.ClientLogin('[email protected]', 'password') | |
spreadsheet_feed = client.GetWorksheetsFeed(key='0Apkoo9QIRiMfdERid001bEltRzFzcG9HM1VBSXY3Rmc') | |
return int(spreadsheet_feed.entry[0].row_count.text)-101 | |
@app.route('/') | |
def hello_world(): | |
return 'Подано заявок: %s' % getRegistrationsCount() | |
if __name__ == '__main__': | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment