Imagine post with url as a content.
Simplifying:
<post><link>http://blablabla.com/</link></post>
I’m looking for a magic function which allow me saving in database which url from posts has been clicked. For instance someone clicks the url and not only it opens in new window but also backround magic function saves this event in database. Can I the url and def at once? I have an app build in django. If there is anybody who knows how to bite it? If yes, could you help me?
I would say you have two options here. If it’s an internal link (i.e. http://blablabla.com refers to your own site) you could have the logging functionality built into the receiving view.
Alternatively, you could modify the link to go through your own script which logs the request (urlencoded) before redirecting to the requested page (after decoding):
becomes