Hey, Look Who’s on Twitter! It’s Our OEM!
Aug 13, 2013 / By Andrey Goryunov
Sometime in the near future…
Finally, that day came. He was the last human being to stay on Twitter with the “others”, and he did a good job trying to keep up with “them”. But today is going to be his last tweet, the last one by a human being. No more emotional expressions, no more grammar mistakes, no more anything by people… Everything was taken by software. Tweets were clear and straightforward, and they led only to certain reactions. Twitter’s human era had passed, and the last man was trying to understand where it all went wrong, how it happened, and who let software invade the place where people shared their ideas, feelings, emotions… And suddenly he was struck by memory. Right! He recalled the blog post that started it all. It was considered fun at first, but it ended in sadness. He went through his notes and found it:
“Making your OEM tweet is simple. You just need to use the python-twitter library as well as several others to support the extension of EMCLI that uses the libraries:
I uploaded them to the EMCLI directory and unpacked there under directories:
[oracle@em12 emcli]$ tree -d . |-- bindings | `-- default |-- emcliext |-- httplib2-0.8 | |-- python2 | | |-- httplib2 | | | `-- test | | | |-- brokensocket | | | `-- functional | | `-- httplib2.egg-info | `-- python3 | `-- httplib2 | |-- __pycache__ | `-- test |-- packages |-- python-oauth2-master | |-- debian | |-- example | |-- oauth2 | | `-- clients | `-- tests |-- python-twitter-1.0 | |-- doc | |-- examples | |-- python_twitter.egg-info | `-- testdata `-- simplejson-3.3.0 |-- scripts `-- simplejson `-- tests
To use the libraries, I added directories to sys path search so that Jython could find them:
[oracle@em12 emcli]$ ./emcli Oracle Enterprise Manager 12c EMCLI with Scripting option Version 22.214.171.124.0. Copyright (c) 1996, 2013 Oracle Corporation and/or its affiliates. All rights reserved. Type help() for help and exit() to get out. emcli>sys.path.append('python-twitter-1.0') emcli>sys.path.append('simplejson-3.3.0') emcli>sys.path.append('httplib2-0.8/python2') emcli>sys.path.append('python-oauth2-master') emcli>import twitter
No messages came after importing the Twitter module. This means that the import was successful. However, it only happened after changing line 3414 to “except TwitterError, e:”.
$ diff twitter.py twitter.py.orig 3414c3414 < except TwitterError, e: --- > except TwitterError as e:
Before, it was failing with error:
emcli>import twitter Traceback (most recent call last): File "<stdin>", line 1, in <module> File "python-twitter-1.0/twitter.py", line 3414 SyntaxError: mismatched input 'as' expecting COLON
After importing the module, I was able to connect to my Twitter account using generated keys and secrets once I registered the application at https://dev.twitter.com/apps.
After a successful login, I could post messages on Twitter:
emcli>api = twitter.Api(consumer_key='...',consumer_secret='...',access_token_key='...', access_token_secret='...') emcli>api.PostUpdate('D goryunov Test message from #em12c') <twitter.Status object at 0x4> emcli>api.PostDirectMessage('test msg', screen_name="goryunov") <twitter.DirectMessage object at 0x5>
It might not be for production usage, but the example shows that Oracle Enterprise Manager 12c Rel. 3 brought invaluable contribution to the tool’s programmatic functionality, and its abilities are now restricted only by the limits of our imagination.
Happy EMCLI’ing and Jython’ing!”
Massive occupation of Twitter by software started after that. Everyone was adding applications to Twitter. Finally, software took over and started to add itself to Twitter and communicate. Everything changed…
If only he could do something to prevent that blog post from existing… But he could never revert the past. He had to be brave. It was time for his last tweet, the last one from a human being. He opened Twitter, smiled, and started to type…
One Response to “Hey, Look Who’s on Twitter! It’s Our OEM!”
Leave a Reply