ptg7615500 Index849
Twitter, 690–707
authorization with, 694
documentation, 704
hybrid app, 694–706
OAuth credentials for public API, 567
Python and, 691–693
resources, 707
scalability issues, 310
and traffic, 674
Tweepy library for search, 692
Twitter account, authentication, 694
Twitter developers, resources, 597
TWITTER_CONSUMER_KEY setting, 567
TWITTER_CONSUMER_SECRET setting, 567
TWITTER_OAUTH_TOKEN setting, 567
TWITTER_OAUTH_TOKEN_SECRET setting, 567
Twython, 691
camel capitalization, 703
compatibility library for Tweepy and,
693–706
Twython library, 736
installing, 571–572
twython-example.py script, 692
txt2ppt.pyw script, 351–356
txt2ppt() function, 354
type attribute,for socket object, 64
type objects (DB-API), 266–268
type() function, 769, 775
TypeError, 789
types, JSON vs. Python, 721
TyphoonAE back-end system, 676
U
\u escape, for non-ASCII characters, 464
UDP (User Datagram Protocol), 61
client creation, 74–76
executing server and client, 76
server creation, 73–74
UDP/IP socket, creating, 61
UDPServer class (SocketServer module), 79
unary operators, 793
UnboundLocalError, 789
uniCGI.py script, 465
Unicode strings
converting to, 189
in CGI applications, 464–465
regular expression with, 188
vs. ASCII strings, 800–801, 815
__unicode__() method, 579, 791
UnicodeDecodeError, 790
UnicodeEncodeError, 790
UnicodeError, 790
UnicodeTranslateError, 790
union OR, 9
union() function (set types), 784
unit testing in Django, 554–557, ??–563
_unit_*_wrap() functions, 706
Universal Network Objects (UNO), 357
University of California, Berkeley version of
Unix, 58
Unix sockets, 58
UnixDatagramServer class (SocketServer
module), 79
UnixStreamServer class (SocketServer
module), 79
Unix-to-Unix Copy Protocol (UUCP), 96
unquote() function, 403, 404
unquote_plus() function, 403, 404
UPDATE statement (MySQL), 272
UPDATE statement (SQL), 257
update() function (set types), 785
update() function, for database adapter, 288
update() method, 297, 298, 314
update() method (dictionary), 783
update_status command (Twitter API), 695
update_status() function, 704
updateStatus() method, 592
updating database table rows, 255
uploaded file, retrieving, 468
uploading files, 478
application to Google, 629
upper() function, 775
upper() method (string), 781
URIs (Uniform Resource Identifiers), 396
URL mappings, in urls.py file, 558
URL patterns, for Web pages from Django, 527
URLconf file, 543
for Django app, 531–533
for Django project, 529–531
for TweetApprover, 573–575, 576
for TweetApprover poster app, 575
urlencode() function, 403, 404
URLfetch service/API, 614, 616, 672
urljoin() function, 399, 422
urllib module/package, 103, 396, 399, 414, 434
urllib.error module/package, 434
urllib.parse module/package, 434
urllib.quote() function, 402, 476
urllib.quote_plus() function, 402
urllib.requestg module/package, 434
urllib.unquote() function, 476
urllib2 module, 401, 434, 732
authentication example, 405–407
porting, 407–410
urllib2.urlopen() function, 689
urllib2.urlopen() method, 184, 686
urlopen() function, 400–402, 732
importing, 820
urlopen_auth.py script, 405, 406
urlopen_auth3.py script, 409, 410
urlparse module/package, 398–404, 414, 434
urlparse() function, 398, 399
urlpatterns global variable, 519
urlretrieve() function, 402, 404, 415
URLs (Uniform Resource Locators), 396–398
avoiding hardcoding, 591
breaking into components, 398
encoding data for inclusion in URL string,
402