Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Ted k'

API para ver os dados do usuário do Twitter

Recommended Posts

Codigo Completo:

<%
class UserTwitter
private objXMLDOM
private raiz, i
public nome, screen_name, location
public profile_image_url, url
public followers_count, friends_count
public favourites_count, statuses_count
public time_zone, profile_background_color
public profile_text_color, profile_link_color
public profile_sidebar_fill_color, profile_sidebar_border_color
public profile_background_image_url

public sub LerXML()
set objXMLDOM = server.createObject("MSXML2.DOMDocument.3.0")
objXMLDOM.async = false
objXMLDOM.setProperty "ServerHTTPRequest", true
objXMLDOM.validateOnParse = false  
objXMLDOM.load("http://twitter.com/users/show/"&request.queryString("username")&".xml")

set raiz = objXMLDOM.getElementsByTagName("*")

for i = 0 to raiz.length - 1
select case (raiz.item(i).nodeName)
case ("name") : tw.nome = raiz.item(i).text
case ("screen_name") : tw.screen_name = raiz.item(i).text
case ("location") : tw.location = raiz.item(i).text
case ("profile_image_url") : tw.profile_image_url = raiz.item(i).text
case ("url") : tw.url = raiz.item(i).text
case ("followers_count") : tw.followers_count = raiz.item(i).text
case ("friends_count") 	: tw.friends_count 	= raiz.item(i).text
case ("favourites_count") : tw.favourites_count = raiz.item(i).text
case ("statuses_count") : tw.statuses_count = raiz.item(i).text
case ("time_zone") : tw.time_zone = raiz.item(i).text
case ("profile_background_image_url") : tw.profile_background_image_url = raiz.item(i).text
case ("profile_background_color") : tw.profile_background_color = ucase(raiz.item(i).text)
case ("profile_text_color"): tw.profile_text_color= ucase(raiz.item(i).text)
case ("profile_link_color"): tw.profile_link_color= ucase(raiz.item(i).text)
case ("profile_sidebar_fill_color") : tw.profile_sidebar_fill_color = ucase(raiz.item(i).text)
case ("profile_sidebar_border_color") : tw.profile_sidebar_border_color = ucase(raiz.item(i).text)
end select
next
set objXMLDOM = nothing
end sub

end class

set tw = new UserTwitter
tw.LerXML()
%>

Resultado:

Imagem Postada

 

Baixar o Script: http://tedk.com.br/blog/images_extras/user_twitter.rar

Compartilhar este post


Link para o post
Compartilhar em outros sites

este recupera algumas info. tb e pode entrar com um novo texto

 

<%
Response.Buffer = True
Dim xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

twitter_username = "seu_login" 'mude para seu username
twitter_password = "sua_senha" 'mude para seu password

new_status = "Entre com um novo texto, aqui!  " 'mude para novo status

xml.Open "POST", "http://" & twitter_username & ":" & twitter_password & "@twitter.com/statuses/update.xml?status=" & server.URLencode(new_status), False
xml.setRequestHeader "Content-Type", "content=text/html; charset=utf-8"
xml.Send

Response.Write xml.responseText

Set xml = Nothing 
%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.