You want to use the string.match method.
First of all, you want to use parenthesis in your "cut", or your string pattern to tell which part you want to grab (I'm also going to fix it for you here since it was designed to grab the forum posts):
local cut = [[<p class="stat%-title">Join Date</p>%S+<p class="rbx%-lead">(.-)</p>]]
So. what's going on here?
Well, here's an example of how the HTML would look:
...
<p class="stat-title">Join Date</p>
<p class="rbx-lead">1/5/2013</p>
...
Well, obviously you want to extract "1/5/2013" here. The most obvious solution is to use the pattern <p class="rbx%-lead">(.-)</p>. % means that the following character will be "escaped", so that Lua ignores its special behavior. (.-) means "match as few characters as possible", which would match 1/5/2013 since it also wants to find the <p class... string before (.-) and </p> after it.
But here's the problem: There are other things matching that pattern, too, such as the place visits and forum posts. You'll have to specify what you REALLY want to find.
That's why I added the beginning: <p class="stat%-title">Join Date</p>%S+
This obviously matches the code for the label. %S+ means that it should also match all the whitespace, since there are newlines and stuff after it.
Now, you'll have to request the page and match it:
local id = 1
local httpservice = game:GetService("HttpService")
local url = "http://rproxy.pw/users/" ..id.. "/profile"
local html = httpservice:GetAsync(url)
local cut = [[<p class="stat%-title">Join Date</p>%S+<p class="rbx%-lead">(.-)</p>]]
local joindate = html:match(cut);
For further information:
Also, I haven't tested the code, but it should work.
5 comments
How do I get it to work?
I am having that same problem. I'm trying to figure it out, but sadly it seems like it doesn't work. Check my edited answer to see the code I tried to use to get it to work.
This prints out the whole webpage and the match string "cut" is incorrect anyway.
I'm still getting 'nil'.
Thanks to whom ever down voted. This gets you close and I know the cut doesn't work. I did not come up with this code. This code does get you closer to having the join date though. You could possibly try a string.find(html, "Join Date
<p id="rbx-lead">%a+") and see if it gets it.