How to implement a simple Google Checkout callback function with Django? - python

I have a simple 'Buy Now' Google Checkout button on my Django site (very simple; no basket or anything more fancy). What I want is for Google to send a notification to a URL on my server once a new order has been processed. The notification should tell me the customer's email address and name (preferably as simple POST params). Then I can take this info and set up a user account, send out a confirmation email, etc.
This sounds simple. However, all I can find by way of documentation on Google's site is a dense and impenetrable thicket of competing versions, protocols, and APIs with no clear tutorials or example code. It is a nightmare.
Furthermore, I can see no obvious way of testing out the functionality. I continually see references to a 'sandbox', but I can find no concrete information on what this is or how to set it up. The URL 'sandbox.google.com' returns a 503 error.
Can anybody give me a pointer?
Thanks in advance.
Tom

Take a look at how Satchmo handles notifications in: payment.modules.google

Related

Can you get general user account activity via the Instagram API?

I was wondering if it's possible to utilize the Instagram API with Python in order to gather info on follower account status to seek trends/activity/etc. for my platform. Basically I want to see what brands, etc. users engage with by using the API to see where the accounts who are part of my network go, what they click like on, where they leave a comment/what type of feedback they give/interact across brands. The accounts will consent to this of course, but is this even possible with the API anyways? I have seen services offer this for a fee, so I assumed it's possible somehow.
I assume that when a user leaves a comment it is stored in some database that you can then use the API to see if it matches with some ID or such -- if not then maybe there is a way to do this indirectly, i.e., some kind of background service that can see if a comment/ID matches a username without having to use the API itself. Basically I'm interested if this is feasible/simple -- I'm not too savvy!
This is meant for business and non-business/personal accounts -- also just for the fun of it too.
I have peeked at the API but it does not mention this, and no amount of searching narrows it down.
I know Facebook made some changes with their graph API which basically makes this a dead end on their platform without some possible hackaround if that is even theoretically possible.

Can Pybossa be used as a micro tasking / contest platform?

I was wondering if it was possible to use Pybossa as a micro tasking / contest platform?
I am looking for something where I can register users, and get them to complete micro tasks such as twitter upvotes, retweeting, commenting, as well as reddit, youtube and things like that?
One platform currently is vyper.io which does a similar thing.
I was looking for an open source alternative that I can customise myself.
Can Pybossa do this? or if not, do you know if something else similar can?
Thank you
You can do that with PYBOSSA. Basically, PYBOSSA allows you to design any type of data, due to its JSON data storage facilities. In there you can put images, audios, webmaps, anything that can be rendered on the web and then ask users to complete those micro-tasks.
PYBOSSA has webooks APIs, allowing you to react in real-time to the feedback the users are sending to you. Thus, imagine that you are asking to upvote a given image. Say you want at least 10 people to participate in it. When the tenth person sends his/her feedback, PYBOSSA will notify you via the webhooks solution that this task has been completed. Then, another micro-service could get it, do some statistics analysis and say, hey 8 out 10 agree this is the best image. Then, you can push that info to any other service like Twitter, Facebook, etc.
I hope it helps you.
NOTE: I'm the creator of PYBOSSA.

Capturing information for customers such a referral URL and conversion

I was hoping to create my own in-house analytics so I tell my customers how many visits their company page got on my site and which URL they came from. I am coding this in Python (Flask) and I wondered if anyone could tell me what is the standard, or sensible approach to this problem.
I think it might be to have some sort of Redis queue which is triggered when a visitor comes and then this information is added to the database later so the site doesn't seem slow.
The standard, and sensible approach is to use Google Analytics. If you must roll your own, you have one of two approaches. JavaScript that is executed on every page (like GA) and pulls this kind of info into a DB. The second approach is parsing log files on the server. Awstats is a good bet for that.

Detection from e-mail address: Google Calendar user?

I'm doing a small app juggling with calendars and I'd love to send invitations to my user's contacts.
I'm wondering, is there a way (even complicated, I don't mind) which would allow me to know whether a particular contact uses Google Calendar or not, so I could send them plain e-mail invitation or full-featured Google Calendar invitation (which they are familiar with and can respond to them with one click from Gmail)?
Input: Contact's e-mail address. (e.g. steve.jobs#apple.com, my.mom#gmail.com, ...)
Output: Boolean information "does this contact use Google Calendar?"
subtask: Boolean information "does this contact even use Google apps?"
It's more or less possible to solve the subtask. Google uses two domains that directly yell at programmer "we are from Google!!!", that's gmail.com and googlemail.com (second one used in UK and Germany due to some legal restrictions). In Python, it's this simple:
def uses_google(email):
return email.endswith(('gmail.com', 'googlemail.com'))
Well, then there are Google Apps. Anyone can run them on his own domain. This should (as far as OpenID is properly installed) solve answer to this question: How to detect if an email is a Google Account?
But what about the usage of Google Calendar?
And is it even necessary to solve such problem? What happens if I send invitations to e-mails without any connection to Google Calendar? Something tells me it wouldn't be nice (maybe only notice "Honza sent you invitation, start using Google Calendar if you'd like to respond"). As a user of the Calendar I know when someone sends invitation to me on wrong e-mail, I can't even respond to it.
A lot of questions here, but I'll take a crack at this.
First off, using Google's mail service doesn't guarantee that the owner use other Google services. Yes, you can assume they have access and they'll be able to accept an invitation, but it doesn't mean they use it as their calendar.
As for somehow gleaning information about Google services used based on a non-Google email address, this does not seem possible. This information is private between the customer and Google, and also borders on proprietary to Google I imagine.

I'm searching for a messaging platform (like XMPP) that allows tight integration with a web application

At the company I work for, we are building a cluster of web applications for collaboration. Things like accounting, billing, CRM etc.
We are using a RESTfull technique:
For database we use CouchDB
Different applications communicate with one another and with the database via http.
Besides, we have a single sign on solution, so that when you login in one application, you are automatically logged to the other.
For all apps we use Python (Pylons).
Now we need to add instant messaging to the stack.
We need to support both web and desktop clients. But just being able to chat is not enough.
We need to be able to achieve all of the following (and more similar things).
When somebody gets assigned to a task, they must receive a message. I guess this is possible with some system daemon.
There must be an option to automatically group people in groups by lots of different properties. For example, there must be groups divided both by geographical location, by company division, by job type (all the programers from different cities and different company divisions must form a group), so that one can send mass messages to a group of choice.
Rooms should be automatically created and destroyed. For example when several people visit the same invoice, a room for them must be automatically created (and they must auto-join). And when all leave the invoice, the room must be destroyed.
Authentication and authorization from our applications.
I can implement this using custom solutions like hookbox http://hookbox.org/docs/intro.html
but then I'll have lots of problems in supporting desktop clients.
I have no former experience with instant messaging. I've been reading about this lately. I've been looking mostly at things like ejabberd. But it has been a hard time and I can't find whether what I want is possible at all.
So I'd be happy if people with experience in this field could help me with some advice, articles, tales of what is possible etc.
Like frx suggested above, the StropheJS folks have an excellent book about web+xmpp coding but since you mentioned you have no experience in this type of coding I would suggest talking to some folks who have :) It will save you time in the long run - not that I'm saying don't try to implement what frx outlines, it could be a fun project :)
I know of one group who has implemented something similar and chatting with them would help solidify what you have in mind: http://andyet.net/ (I'm not affiliated with them at all except for the fact that the XMPP dev community is small and we tend to know each other :)
All goals could be achieved with ejabberd, strophe and little server side scripting
When someone gets assigned to task, server side script could easily authenticate to xmpp server and send message stanza to assigned JID. That its trivial task.
To group different people in groups, it is easily can be done from web chat app if those user properties are stored somewhere. Just join them in particular multi user chat room after authentication.
Ejabberd has option to automatically create and destroy rooms.
Ejabberd has various authorization methods including database and script auth
You could take look at StropheJS library, they have great book (paperback) released. Really recommend to read this book http://professionalxmpp.com/

Categories