Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Pessoal,
Fiquei sabendo e sinceramente tive dúvida sobre esse tópico, tanto que postei no Subfórum de Mídias Sociais aqui do iMasters uma dúvida parecida com essa, a questão é, alguém conhece alguma funcionalidade através de RSS que eu possar exibir minhas atualizações do site (de notícias) no Facebook, Orkut etc?
Espero que possam me ajudar a esclarecer essa dúvida...
Abraços
Justamente a primeira opção, o que eu atualizar no meu site na área de notícias, automaticamente ser colocado no facebook... por exemplo
olha em AJAX, esse pequeno exemplo simples ele le as RSS do G1 (Brasil), salva como "news.html" por exemplo e coloque em seu servidor e acesse
<script language="Javascript" type="text/javascript">
var RSSDoc = new ActiveXObject("Microsoft.XMLHTTP");
RSSDoc.open("GET", "[http://g1.globo.com/Rss2/0,,AS0-5598,00.xml",](http://g1.globo.com/Rss2/0,,AS0-5598,00.xml) true);
RSSDoc.onreadystatechange = function() {
if (RSSDoc.readyState == 4) {
if (RSSDoc.status == 200) {
var XML_RSS = RSSDoc.responseXML;
var ItensRSS = XML_RSS.getElementsByTagName("item");
var HTML_new = "";
for (var i = 0; i < ItensRSS.length; i++) {
var Title = ItensRSS[i].getElementsByTagName("title")[0].firstChild.nodeValue;
var URL = ItensRSS[i].getElementsByTagName("link")[0].firstChild.nodeValue;
HTML_new += '<a href="' + URL + '" target="_blank">• ' + Title + '</a><br>';
}
document.write(HTML_new);
} else {
alert("Erro no RSS: " + RSSDoc.statusText + " (" + RSSDoc.status + ")");
}
}
}
RSSDoc.send(null);
</script>
abaixo em ASP
<%
' Script ASP Para leitura de arquivos de RSS.
url = "http://feeds.folha.uol.com.br/folha/emcimadahora/rss091.xml" 'Aqui vai o endereço do arquivo RSS, ou do arquivo "gerador"
' Criando Objeto XML
Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")
objXML.async = false
objXML.setProperty "ServerHTTPRequest", True
' Não validar o arquivo
objXML.validateOnParse =false' true
' Retirar espaços
objXML.preserveWhiteSpace = false
blnLoaded = objXML.Load(url)
If Not blnLoaded Then
Response.write "Nenhuma notícia na fonte!"
Else
set objNodeList = objXML.getElementsByTagName("channel")
For Each objNode In objNodeList
For Each objNode2 In objNode.childNodes
Select Case objNode2.nodeName
Case "title"
html = html &"<tr><td><b>"
html = html &objNode2.firstChild.nodevalue
html = html &"</b></td></tr>"
Case "link"
html = html &"<tr><td><a target=_blank href="& objNode2.firstChild.nodevalue &">"
html = html & objNode2.firstChild.nodevalue
html = html &"</a></td></tr>"
Case "description" 'Está desabilitado para exibir apenas os links
html = html &"<tr><td><i>"
html = html & objNode2.firstChild.nodevalue
html = html &"</i></td></tr>"
End Select
Next
Next
html = html &"<tr><td><hr></td></tr>"
Set objNodeList = objXML.getElementsByTagName("item")
For Each objNode In objNodeList
For Each objNode2 In objNode.childNodes
Select Case objNode2.nodeName
Case "title"
strTitle = objNode2.firstChild.nodevalue
Case "link"
strURL = objNode2.firstChild.nodevalue
Case "description"
strDescription = objNode2.firstChild.nodevalue
End Select
Next
html = html &"<tr><td><li/><b><a target=_blank href="& strURL &">"& strTitle &"</a></b><br>"& strDescription &"</td></tr>"
strTitle = ""
strURL = ""
strDescription = ""
Next
html = "<table>"& html &"</table>"
set objNodeList = Nothing
End if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<%
Response.write (html)
%>
</body>
</html>Ótimo, valeu ! vou utilizar aqui ;D
OK, belezA...
você quer colocar suas atualizações em suas páginas hospedadas no Facebook e orkut ???
ou quer pegar as noticias desses sites e disponibilizar no seu ???