2011-09-22 17 views
6

io messgae metto a INPDAP tramite link: http://twitter.com/intent/tweet?source=webclient&text=HelloRichiamata dopo la pubblicazione messaggio a Twitter

Sono interessato a se è possibile per essere reindirizzati ad alcuni URL dopo aver postato un messaggio? Ad esempio, Facebook ha il parametro "redirect_uri" aggiunto all'URL. L'utente viene reindirizzato a questo URL dopo che il meesage è stato pubblicato sul muro.

+0

Ecco un esempio di lavoro https://stackoverflow.com/questions/36305586/after-successful-tweet-execute- the-callback-twitter/47453295 # 47453295 –

+0

Ecco un esempio funzionante: https://stackoverflow.com/questions/36305586/after-successful-tweet-execute-the-callback-twitter/47453295#47453295 –

risposta

1

In base allo documentation, l'intento web tweet non ha un parametro che consente all'utente di tornare al tuo sito Web dopo che il tweet è stato pubblicato.

La maggior parte dei siti web che ho visto presentano l'intento del web in un popup invece di mandare l'utente lontano dal proprio sito.

4

È possibile utilizzare eventi vincolanti per Web Intents per reindirizzare a un URL dopo il tweeting.

window.twttr = (function (d,s,id) { 
    var t, js, fjs = d.getElementsByTagName(s)[0]; 
    if (d.getElementById(id)) return; js=d.createElement(s); js.id=id; 
    js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); 
    return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } }); 
}(document, "script", "twitter-wjs")); 
twttr.ready(function (twttr) { 
twttr.events.bind('tweet', function (event) { //redirect to your url }); 
}); 

seguenti link potrebbero aiutare:

https://dev.twitter.com/docs/intents/events#events

https://dev.twitter.com/discussions/671

+2

"Questo evento sarà essere attivato quando l'utente fa clic su un Tweet Web Intent. " - Ciò significa che è attivato prima e non dopo il tweet. Un utente può annullare prima di inviare il tweet ... – samura

Problemi correlati