Problem with Twitter-PHP and My Script |
Author: |
Message: |
m0nst3rkill3r
Junior Member
Posts: 51
Joined: Sep 2009
|
O.P. Problem with Twitter-PHP and My Script
Hey.
First of all. Im a newbee^^
I wrote a Php script that checksout the xml of my account.
it saves the text in c:/twitter.txt
My Plus Script reads out this text, and set it to the Statusbar.
That works with /twitt
how can i "open" the phpfile with javascript ?
please help me
greetings
/edit:
Sure, its localhost/twitter.php ^^
This post was edited on 09-14-2009 at 07:06 PM by m0nst3rkill3r.
|
|
09-14-2009 06:58 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Problem with Twitter-PHP and My Script
|
|
09-14-2009 07:17 PM |
|
|
m0nst3rkill3r
Junior Member
Posts: 51
Joined: Sep 2009
|
O.P. RE: Problem with Twitter-PHP and My Script
Okay Thank you for your Response!.
But i does not work, how i want it.
That's my Php.
code: <?php
$datei = "C:/twitter.txt";
$xmltext = join(file("http://www.twitter.com/status/user_timeline/p3acemak3r.xml"), "");
$xmlobj = simplexml_load_string($xmltext);
print header("Content-type: text/plain");
//print_r ($xmlobj);
$twitt = $xmlobj->status->text;
print ($twitt);
$dat=fopen($datei,"w+");
fwrite($dat,$twitt);
fclose($dat);
?>
If i open it in my Browser, it works everything.
But if i use :
code: xmlhttp.open("GET", "http://localhost/twitter/twitter.php", true);
xmlhttp.send('');
Nothing works.
|
|
09-14-2009 07:42 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Problem with Twitter-PHP and My Script
js code: getPageText ( 'http://www.twitter.com/status/user_timeline/p3acemak3r.xml' );
function getPageText ( url ) {
var xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
xmlhttp.open('GET', url, true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
Debug.Trace(xmlhttp.responseText);
}
}
xmlhttp.send('');
}
Or you can use the URLDownloadToFileW:
js code: getPageText ( 'http://www.twitter.com/status/user_timeline/p3acemak3r.xml' , 'C:\\twitter.txt' )
function getPageText ( url , file ) {
return Interop.Call ( 'urlmon', 'URLDownloadToFileW', null, url, file, 0, 0 ) === 0
}
|
|
09-14-2009 08:03 PM |
|
|
m0nst3rkill3r
Junior Member
Posts: 51
Joined: Sep 2009
|
O.P. RE: Problem with Twitter-PHP and My Script
Yea.
But if you look in the Xml, you see there are many Categorys.
I dont see a Point in the Script where the "Position" is defined.
|
|
09-14-2009 08:11 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: RE: Problem with Twitter-PHP and My Script
quote: Originally posted by m0nst3rkill3r
Yea.
But if you look in the Xml, you see there are many Categorys.
I dont see a Point in the Script where the "Position" is defined.
You would have had to figure that one out for yourself...
js code: getTwitterStatusFromXML ( 'http://www.twitter.com/status/user_timeline/p3acemak3r.xml' );
function getTwitterStatusFromXML ( url )
{
var xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
var xml = new ActiveXObject('Microsoft.XMLDOM');
xmldom.async = true;
xmlhttp.open('GET', url, true);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState === 4 && xmlhttp.status === 200 )
{
xmldom.loadXML ( xmlhttp.responseText );
Debug.Trace ( xmldom.documentElement.selectSingleNode ( '//statuses/status/text' ).text );
}
}
xmlhttp.send();
}
|
|
09-15-2009 12:46 PM |
|
|
m0nst3rkill3r
Junior Member
Posts: 51
Joined: Sep 2009
|
O.P. RE: Problem with Twitter-PHP and My Script
Ahw. Thank you!.
I want to do it myself, but i was disconnected from msn, after i spammed my Contact to the death with my sript .
Anyway. Thank you for your help.
This post was edited on 09-15-2009 at 03:06 PM by m0nst3rkill3r.
|
|
09-15-2009 02:39 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Problem with Twitter-PHP and My Script
I wrote it without even being connected to WLM. I am at work. I wrote it as a HTML file but I had to use the https version of the page as the unsecure is blocked by my work web filter.
|
|
09-15-2009 02:42 PM |
|
|
m0nst3rkill3r
Junior Member
Posts: 51
Joined: Sep 2009
|
O.P. RE: Problem with Twitter-PHP and My Script
Fehler: 'xmldom' is undefined (Code: -2146823279)
Datei: I Love Twitter.js. Zeile: 42.
Skriptstart fehlgeschlagen
I get with your code.
The Problem is, i Can code php and html use css and so on. But javascript i did not learn. I think, that's my new langauge i will learn.
This post was edited on 09-15-2009 at 03:08 PM by m0nst3rkill3r.
|
|
09-15-2009 03:07 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Problem with Twitter-PHP and My Script
Change this: js code: var xml = new ActiveXObject('Microsoft.XMLDOM');
to this: js code: var xmldom = new ActiveXObject('Microsoft.XMLDOM');
My bad!
This is more JScript than Javascript.
|
|
09-15-2009 03:10 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|