generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Club Houses » Let's Make a Deal
Home Search
 

Re: @Web

Previous Thread :: Next Thread 
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:32 PM
Why does this error?

var ID = Number(prompt("ID Of person to view info?"));
$.get("http://api.roblox.com/Users/"+ID+"").success(function(data){
var username = data.Username
var Online = data.IsOnline
var str = "Hello, you are viewing " + username + ", Username!\n"
str+=Online?"User is Online!":"User is Offline"
alert(str);
})

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
ThreeGods is not online. ThreeGods
Joined: 01 Jan 2014
Total Posts: 9471
17 Mar 2015 07:33 PM
Don't see why it's specified @WebGL3d.
Report Abuse
Widths is not online. Widths
Joined: 12 Aug 2014
Total Posts: 41286
17 Mar 2015 07:34 PM
No error for me when I run it

no point in the +"" after +ID in the URL in the argument of $.get tho


-iJava
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:34 PM
forgot eval btw

var ID = Number(prompt("ID Of person to view info?"));
$.get("http://api.roblox.com/Users/"+ID+"").success(function(data){
var username = data.Username
var Online = eval(data.IsOnline)
var str = "Hello, you are viewing " + username + ", Username!\n"
str+=Online?"User is Online!":"User is Offline"
alert(str);
})

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
WebGL3D is online. WebGL3D
Joined: 04 Sep 2013
Total Posts: 28311
17 Mar 2015 07:34 PM
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.roblox.com' is therefore not allowed access.

This means you're trying to access a different sub-domain, which by chrome security, is not allowed. You can do this in chrome extensions, not web pages.


~ 1Topcop ~ WebGL3D ~ Java3D ~ Data3D ~ Purple Squid >
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:35 PM
@Three
he is the javascript god
duh

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
Widths is not online. Widths
Joined: 12 Aug 2014
Total Posts: 41286
17 Mar 2015 07:35 PM
btw the IsOnline in that API is broken
it always returns false from what I've seen


-iJava
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:35 PM
@Web
Ah.
So what API do I need to use to get this information?

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
Widths is not online. Widths
Joined: 12 Aug 2014
Total Posts: 41286
17 Mar 2015 07:36 PM
oh ye forgot i dont have web security
run it on http://api.roblox.com (you need to add jQuery to the page if you are going to do this tho)


-iJava
Report Abuse
WebGL3D is online. WebGL3D
Joined: 04 Sep 2013
Total Posts: 28311
17 Mar 2015 07:36 PM
Could visit their profile, and check the element for whether or not a user is online :P


~ 1Topcop ~ WebGL3D ~ Java3D ~ Data3D ~ Purple Squid >
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:37 PM
@Widths
I'm a newby at this stuff
explain a little better?

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
call23re is not online. call23re
Joined: 11 Nov 2010
Total Posts: 9070
17 Mar 2015 07:39 PM
$.get("http://web.roblox.com/User.aspx?ID=" + user).success(function(data){
var statuscarrier = $('#ctl00_cphRoblox_rbxUserPane_lUserOnlineStatus', $(data));
var status = statuscarrier.text();
if(status.match(/Online/)){
alert("User ID : " + user + " is online.");
}
})


-"The wise never quote."
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:39 PM
@Web, ye Ik.
qq


Also, I noticed I did a couple things wrong, and I removed the online part.


var ID = Number(prompt("ID Of person to view info?"));
$.get("http://api.roblox.com/Users/"+ID+"").success(function(data){
var username = data.Username
var Online = eval(data.IsOnline)
alert("Hello, you are viewing " + username + ", Information!");
})

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:39 PM
@call

Uncaught ReferenceError: user is not defined

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
call23re is not online. call23re
Joined: 11 Nov 2010
Total Posts: 9070
17 Mar 2015 07:40 PM
well yeah because u need to define it!
make a variable called user or something before that

var user = 1;


-"The wise never quote."
Report Abuse
Widths is not online. Widths
Joined: 12 Aug 2014
Total Posts: 41286
17 Mar 2015 07:41 PM
function online(ID) { $.get("http://www.roblox.com/User.aspx?ID="+ID).done(function(x) { x = x.replace(/img/gi, "flip"); var online = $(x).find("#ctl00_cphRoblox_rbxUserPane_lUserOnlineStatus").text()!="[ Offline ]"; var name = $(x).find("#ctl00_cphRoblox_rbxUserPane_lUserRobloxURL").text().replace(/'s Profile/g, ""); var str = name+" is "; str+=online?"online":"offline"; alert(str) });
}
online(1)

-iJava
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:41 PM
@call
u nob
I'll make a prompt for dat
brb

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
ThreeGods is not online. ThreeGods
Joined: 01 Jan 2014
Total Posts: 9471
17 Mar 2015 07:42 PM
Call forgot to paste in the ID.

var user = prompt("which id dawg")

or you could just do

var user = id
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:43 PM
@Widths
that made no sense to me whatsoever

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
Widths is not online. Widths
Joined: 12 Aug 2014
Total Posts: 41286
17 Mar 2015 07:43 PM
oh sorry let me indent it so it is easier for you to read, explained it too

function online(ID) {
$.get("http://www.roblox.com/User.aspx?ID="+ID).done(function(x) { //get the profile, x = data from the page
x = x.replace(/img/gi, "flip"); //fixes a problem where it will say it cannot load certain image
var online = $(x).find("#ctl00_cphRoblox_rbxUserPane_lUserOnlineStatus").text()!="[ Offline ]"; //returns boolean of whether user is online or not
var name = $(x).find("#ctl00_cphRoblox_rbxUserPane_lUserRobloxURL").text().replace(/'s Profile/g, ""); //gets the users name, get rid of 's Profile from the string
var str = name+" is "; //combines the strings together
str+=online?"online":"offline"; //adds online or offline to the string
alert(str); //alert the string
});
}
online(1) //call online with the argument ID = 1


-iJava
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:44 PM
This does not work

var ID = Number(prompt("ID Of person to view info?"));
$.get("http://web.roblox.com/User.aspx?ID=" + user).success(function(data){
var statuscarrier = $('#ctl00_cphRoblox_rbxUserPane_lUserOnlineStatus', $(data));
var status = statuscarrier.text();
if(status.match(/Online/)){
alert("User ID : " + user + " is online.");
}
})

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:45 PM
@Widths
ty

Now I want to figure out the api to enter username, and get id, and all.
c;

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
call23re is not online. call23re
Joined: 11 Nov 2010
Total Posts: 9070
17 Mar 2015 07:46 PM
change
var ID = Number(prompt("ID Of person to view info?"));
to
var user = Number(prompt("ID Of person to view info?"));


-"The wise never quote."
Report Abuse
SquidIy is not online. SquidIy
Joined: 12 Jul 2014
Total Posts: 27509
17 Mar 2015 07:46 PM
I think it's this api?
http://api.roblox.com/users/get-by-username?username=ROBLOX

~FireSliding/SquidIy/muddog15~ | ROBUX: R$1,356 | TIX: Tx0 | RAP: 47,162 |
Report Abuse
ThreeGods is not online. ThreeGods
Joined: 01 Jan 2014
Total Posts: 9471
17 Mar 2015 07:47 PM
idk why ur doing Number(prompt)

just do a normal prompt

obvs ur not dumb enough to enter letters
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » Let's Make a Deal
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image