Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,014 members, 7,806,968 topics. Date: Wednesday, 24 April 2024 at 08:00 AM

Sample Script- Profile Wall Of Facebook - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Sample Script- Profile Wall Of Facebook (14228 Views)

How To Stop Hackers From Posting Nude Pics And Videos On Your Facebook Wall / Mark Zuckerberg The Owner Of FACEBOOK Shared This Romantic & Motivating Words! / Lol, 16 Types Of Facebook Users (2) (3) (4)

(1) (Reply) (Go Down)

Sample Script- Profile Wall Of Facebook by Nobody: 8:32pm On Jan 04, 2009
We want to build a very simple profile wall using ajax.

Please contact me via my website if you need the full code.
Demos:
version 1: http://.net/demos/profile_wall/
version 2: http://.net/demos/profile_wall2/


Meanwhile, if you are not familiar with ajax, please lookup my thread on https://www.nairaland.com/nigeria/topic-214605.0.html - that should teach
you fundamentals of ajax.

The codes will follow shortly.


Download fully at http://blog..net/content/facebook-profile-wall-application
Re: Sample Script- Profile Wall Of Facebook by Nobody: 8:35pm On Jan 04, 2009
Comprise 3 files:
wall.txt - for holding the data - we are not using dbase in this one.
post.php - for saving entry into wall.txt
index.html - our main file

In the download version, the wall.txt is empty

post.php

<?php
$text="<hr align='left'>".date("m:i:s "wink.$_REQUEST['text'];

$handle = fopen("wall.txt", "a"wink;
fwrite($handle,$text);
fclose($handle);

echo $text;
?>



index.html

<title>Profile Wall</title>
<script>
function ajaxRequest() {
var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
for (var i=0; i<activexmodes.length; i++){try{return new ActiveXObject(activexmodes[i])} catch(e){alert("Failed"wink;}}
} else if (window.XMLHttpRequest) {return new XMLHttpRequest()} else {return false}
return;
}

function download(url) {
var mygetrequest=new ajaxRequest();
url+="?&"+new Date().getTime();
mygetrequest.onreadystatechange=function(){
if (mygetrequest.readyState==4){
if (mygetrequest.status==200) {document.getElementById('display').innerHTML=mygetrequest.responseText;}
else {
//alert("Download was not successful"wink;
}
}
}
mygetrequest.open("POST", url, true);
mygetrequest.send(null);
}


function post2(url,flag) {
var mygetrequest=new ajaxRequest();
url+="&"+new Date().getTime();
mygetrequest.onreadystatechange=function(){
if (mygetrequest.readyState==4){
if (mygetrequest.status==200) {
var d=document.getElementById('display');
d.innerHTML=mygetrequest.responseText+d.innerHTML;
document.getElementById('textbox').value="";
}
else {
alert("Connection failed."wink;
}
}
}
mygetrequest.open("POST", url, true);
mygetrequest.send(null);
}


function post(text) {
if(text.value==""wink {return;}
post2("post.php?text="+text.value);
}
</script>

<style>
input.text {width:200px;}
hr {width:200px;text-align:left;}
</style>

<body onload="download('wall.txt');">

Type Text Here and press enter:<br>
<input class="text" id="textbox" type="text" style="wdith:200px" onkeypress="if(event.keyCode==13) {post(this);}">

<div id="display"></div>

</body>


Explanations will follow in the next post.
Re: Sample Script- Profile Wall Of Facebook by Nobody: 8:44pm On Jan 04, 2009
Our PHP file

<?php
$text="<hr align='left'>".date("m:i:s "wink.$_REQUEST['text'];

$handle = fopen("wall.txt", "a"wink;
fwrite($handle,$text);
fclose($handle);

echo $text;
?>


The first line: $text="<hr align='left'>".date("m:i:s "wink.$_REQUEST['text'];
just appends an HR element, followed by date and the text you entered in the textbox from the main page.

The next functions will append [add to the end of wall.txt]

$handle = fopen("wall.txt", "a"wink;
fwrite($handle,$text);
fclose($handle);


Then finally the script will spit out the
processed text
echo $text;
which is picked by the same ajax that called it and appended to the begining of the "display" div used in the main page.


index.html

<title>Profile Wall</title>
<script>
function ajaxRequest() {
var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
for (var i=0; i<activexmodes.length; i++){try{return new ActiveXObject(activexmodes[i])} catch(e){alert("Failed"wink;}}
} else if (window.XMLHttpRequest) {return new XMLHttpRequest()} else {return false}
return;
}

function download(url) {
var mygetrequest=new ajaxRequest();
url+="?&"+new Date().getTime();
mygetrequest.onreadystatechange=function(){
if (mygetrequest.readyState==4){
if (mygetrequest.status==200) {document.getElementById('display').innerHTML=mygetrequest.responseText;}
else {
//alert("Download was not successful"wink;
}
}
}
mygetrequest.open("POST", url, true);
mygetrequest.send(null);
}


function post2(url,flag) {
var mygetrequest=new ajaxRequest();
url+="&"+new Date().getTime();
mygetrequest.onreadystatechange=function(){
if (mygetrequest.readyState==4){
if (mygetrequest.status==200) {
var d=document.getElementById('display');
d.innerHTML=mygetrequest.responseText+d.innerHTML;
document.getElementById('textbox').value="";
}
else {
alert("Connection failed."wink;
}
}
}
mygetrequest.open("POST", url, true);
mygetrequest.send(null);
}


function post(text) {
if(text.value==""wink {return;}
post2("post.php?text="+text.value);
}
</script>

<style>
input.text {width:200px;}
hr {width:200px;text-align:left;}
</style>

<body onload="download('wall.txt');">

Type Text Here and press enter:<br>
<input class="text" id="textbox" type="text" style="wdith:200px" onkeypress="if(event.keyCode==13) {post(this);}">

<div id="display"></div>

</body>


I have already done justice to most of the functions in this in my ajax thread which i mentioned above.
I will only explain the necessary functions.

When the page loads, it will call the download function which will dump the entire wall.txt into the display div object.

if (mygetrequest.status==200) {document.getElementById('display').innerHTML=mygetrequest.responseText;}


When u type into the textbox and press enter - it will detect this and call the post function

function post(text) {
if(text.value==""wink {return;}
post2("post.php?text="+text.value);
}


The post function evaluates if you have actually entered any data - if not it exits.
If you have entered data - it calls the post2 function and passes a url like post2.php?text=yo!

post2.php will append it and post back the processed data as reponseText which is now added to the already growing list.

document.getElementById is used to access elements that you have assigned ID for earlier.
innerHTML is used to manipulate the html content being displayed by an object.
Re: Sample Script- Profile Wall Of Facebook by Nobody: 8:45pm On Jan 04, 2009
To install this on your server, dont forget to change the attribute/permission/chmod the wall.txt to 755
Re: Sample Script- Profile Wall Of Facebook by smakcad(m): 12:00pm On Dec 07, 2009
ok bros thank u.u hv really helped some of us.then on ur side which would u say is better-drupal or joomla (or dromla like the other guy called it)
Re: Sample Script- Profile Wall Of Facebook by DualCore1: 12:54pm On Dec 07, 2009
i need to put a copyright on my posts. hey its "droomla" double "o". grin
Re: Sample Script- Profile Wall Of Facebook by MyHonour(m): 6:54pm On Jan 04, 2010
affi copyright o. na you sabi.
Re: Sample Script- Profile Wall Of Facebook by DualCore1: 8:01pm On Jan 04, 2010
shay u want make we go court ni?
Re: Sample Script- Profile Wall Of Facebook by OmniPotens(m): 9:10am On Jan 05, 2010
You better stop all these off-topic posts. Maintain the main topics please.
Re: Sample Script- Profile Wall Of Facebook by DualCore1: 9:19am On Jan 05, 2010
Don't mind MyHonour and Smakcad. angry

So, has anyone run this script? smiley
Re: Sample Script- Profile Wall Of Facebook by OmniPotens(m): 11:23am On Jan 05, 2010
You are a developer, ain't you? You can give it a trial. I'm on another project but have bookmarked the download link. I'll give a trial soon. What about you?
Re: Sample Script- Profile Wall Of Facebook by MyHonour(m): 6:17am On Jan 06, 2010
I tested it out while i woz creating this thread in my former life-time.
Re: Sample Script- Profile Wall Of Facebook by DualCore1: 9:08am On Jan 06, 2010
Chineke!!
Oga na you? Ahhhh!! no court o. Hmmmm, the profile pic just sold ya ID sharply.


Omni, I'll check it our shortly.
Re: Sample Script- Profile Wall Of Facebook by MyHonour(m): 10:46am On Jan 06, 2010
Dual Core:

Chineke!!
Oga na you? Ahhhh!! no court o. Hmmmm, the profile pic just sold ya ID sharply.


Omni, I'll check it our shortly.
. . .or i could be a photo-copy of the original. . .
Re: Sample Script- Profile Wall Of Facebook by baccifinejewelry: 7:10am On Jul 13, 2010
I have to learn ajax first before I post any comment here.
Re: Sample Script- Profile Wall Of Facebook by Nobody: 9:33am On Mar 30, 2011
The demo script has been moved to http://.net/demos/profile_wall/
Re: Sample Script- Profile Wall Of Facebook by Nobody: 9:40am On Mar 30, 2011
The part 2 of this thread is located on https://www.nairaland.com/nigeria/topic-634593.0.html
that features the new profile wall script - http://.net/demos/profile_wall2/
Re: Sample Script- Profile Wall Of Facebook by Nobody: 12:53am On Mar 31, 2011
coincidentally working on a profile wall, but in as3
Re: Sample Script- Profile Wall Of Facebook by Nobody: 4:59am On Mar 31, 2011
muy muy bien. great to see you amigo. tis been like several years mehn!
i will like to see it when you are through with it
Re: Sample Script- Profile Wall Of Facebook by anyla: 6:57pm On May 09, 2011
[/b]pls i need your help i want a script which can posts several wall posts with a click my id is been hacked on facebook and the person is using it in bad way i need to post on its wall that its a fake id wen ever i post it the person delete it so i need to post so many time that he cant delete it in a minute pls help me.i will be very thankfull kindly email me the script on poisongul@gmail.com i will be soo great to have it thankyou.[b]
Re: Sample Script- Profile Wall Of Facebook by Nobody: 8:46pm On May 09, 2011
Lai Lai sorry, that sounds like a malicious script to me, i dont do that kinda stuff at all. . . .
Re: Sample Script- Profile Wall Of Facebook by anyla: 10:16pm On May 09, 2011
ok thankyou.
Re: Sample Script- Profile Wall Of Facebook by Slyr0x: 10:17pm On May 09, 2011
anyla:

[/b]pls i need your help i want a script which can posts several wall posts with a click my id is been hacked on facebook and the person is using it in bad way i need to post on its wall that its a fake id wen ever i post it the person delete it so i need to post so many time that he cant delete it in a minute pls help me.i will be very thankfull kindly email me the script on poisongul@gmail.com i will be soo great to have it thankyou.[b]

==
Off Topic
http://www.facebook.com/anila.farooq -
University of Karachi, Pakistan Institute of Fashion Design

She also speaks spanish.[size=3pt] DHTML dis myt just be yo catch wink[/size]

OnTopic
Dyu still have access to your account? If Yes, then change your password and also change yo gmail password. .and also make sure you don't use the same pwd 2ce.
Re: Sample Script- Profile Wall Of Facebook by Nobody: 8:35am On May 10, 2011
So what if she habla espanol? it does not mean she is still not an africano o nigeriano eh?
Well.  .  .errrr. . . .ehmmmmm. . .do as slyr0x says. . .but seriously, i dont deal in scripts
that can be used to harm anything. . . (though some have been exported annonymously
out of my lab without my knowing, sometimes we create bad as a by-product of good)

But that still did not stop me from telling her "Hola Preciosa Bonita" on facebook sha
Re: Sample Script- Profile Wall Of Facebook by Slyr0x: 9:03am On May 10, 2011
She no be Africano or nigeriano jare. .Yhu no see pics ni?
Re: Sample Script- Profile Wall Of Facebook by Nobody: 11:04am On May 10, 2011
Slyr0x:

She no be Africano or nigeriano jare. .Yhu no see pics ni?
Aho, that was because you did not know that i modified my post by adding:


But that still did not stop me from telling her "Hola Preciosa Bonita" on facebook sha
After i saw the fine omo elle(in yoruba not ella en spanish). . .in fact, i wont mind giving her
all my scripts and lyrics!
Re: Sample Script- Profile Wall Of Facebook by Slyr0x: 11:10am On May 10, 2011
hehehe. .#badtGuys. . Abeg visit my thread jor. .The one iAsked a Q as regards best blogger to use.
Re: Sample Script- Profile Wall Of Facebook by Nobody: 11:23am On May 10, 2011
Slyr0x:

hehehe. .#badtGuys. . Abeg visit my thread jor. .The one iAsked a Q as regards best blogger to use.
i will sheck it shortly. . .nawa for you o, #babe shows up, *you do dns lookup! gbam.
Re: Sample Script- Profile Wall Of Facebook by Slyr0x: 11:31am On May 10, 2011
Na so o0. .You gatz check for record types nau if she be alaba made or original. wink
Re: Sample Script- Profile Wall Of Facebook by Nobody: 12:15pm On May 10, 2011
Yeah, her dns is authentic though, very admirable indeed
Re: Sample Script- Profile Wall Of Facebook by adedapoet: 8:56pm On Jul 04, 2011
dhtml, can i have your number pls, wish you could take me one-on-one
No bi everybodi sabi get along with online tutorial sad
Re: Sample Script- Profile Wall Of Facebook by Nobody: 9:11pm On Jul 04, 2011
Well, it is true what you said. Any people do say sometimes that my scripts are a bit hard for beginners to follow, you can get my phone number from
http://.com/contactus.php

(1) (Reply)

This Is What Google Adsense Said Every Blogger Must Do Now / Have You Ever Wondered, Why Are Web Addresses In English? / How To Get Instant Adsense Approval

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 46
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.