Home » Odeon Blogs » Stefan Talpalaru, CTO »

introducing pyopeninviter

introducing pyopeninviter

When switching from PHP to Python (long time ago) we felt one important shortcoming for our social components - the lack of a contact importer. There was a great one for PHP - openinviter - but no python equivalent, so we came up with this wrapper: pyopeninviter. By using the command line php interpreter we call the openinviter functions, encode their output as JSON and decode it in python. The concept is quite simple, really, and the code in api.py is straight forward. A bit uglier is what happens in cli.php, partly because of PHP itself, partly because of the error handling. Take a look at the examples in test.py for the final result and have fun using it.


Categories: Python pyopeninviter

Discussion

  1. andre on Aug 25, 2010 - 11:27 said:

    Just curious was there anything in particular that prevented you from just porting the whole thing over to python? running it through the php interpreter seems hacky at best, and not something I would consider doing on a production website.


  2. The various modules are a moving target (they are, after all, depending on web site layouts) and I don't want to keep on converting to python whatever fix is provided in PHP upstream.




Leave a Comment :

(required)


(required)




(required)




(required)






Leave a Comment


Page generated in: 0.14s