392Views35Replies

Author Options:

Instructable Playercard API? Answered

Is there anyway to embed your instructable playercard onto your personal website/blog?

35 Replies

user
Kiteman (author)builderkidj2011-05-01

(Disappearing comment bug strikes - second attempt)

Click on anybody's username, and look to the top-left: user stats are presented in Top Trump format.

You can still buy a set of real cards as well if you look at step four here.

https://www.instructables.com/id/Instructables-Top-Trumps/


Select as Best AnswerUndo Best Answer

user
Doctor Freeman (author)Kiteman2011-05-03

heh, that happened to me on your latest fourm.

Select as Best AnswerUndo Best Answer

user
builderkidj (author)Kiteman2011-05-01

I saw what you look like in real life and thanks for the advice/tip


J

My real name is Jordan,Don't ya know
I'm 11

Select as Best AnswerUndo Best Answer

user
Lithium Rain (author)2011-04-15

Like Nacho said - it's all there, so really all you would need to do is scrape the data off the page and display it. Google Is Your Friend as far as the specific PHP, but it shouldn't be hard: Grab only the data you want from the page, and display that (presumably as HTML) on the webpage.

...Hm. I'm looking more at the source, and now I'm not so sure that's true. The info in the card isn't anywhere to be found in it (unless I'm sorely mistaken), and I can't see it embedded as an image. I'm not so sure how it's generated or where the actual data is stored, now.

>thinks aloud< Maybe they query the database every so often and just generate ALL the images once a month or something, and they stay the same all month? Surely not. Also, why can't one find the image if that's the case? This is interesting (at least to me; if someone sees I'm missing something incredibly simple please do call me on it :P ). I'll have to watch my card and see how often it updates...

Select as Best AnswerUndo Best Answer

user
kelseymh (author)Lithium Rain2011-04-15

They use CSS to handle the formatting (as Nacho has very nicely demonstrated).

If you scan through the page source of your profile page (the one other users see, not /you/), you can pick off the URL from the JavaScript for the card display:

https://www.instructables.com/member/statscard/?screenName=kelseymh

If you access that URL directly (plug in whatever username you want), you'll see that it shows up in a relatively unformatted way; it's the CSS that makes it all pretty.

But you could easily script up something to parse the raw HTML to capture things like number of I'bles or whatever.

Select as Best AnswerUndo Best Answer

user
Lithium Rain (author)kelseymh2011-04-19

Now, why is this comment only showing up now?

(...oh, I see the bad word now...sigh...)

Yes indeed, I just blew past it in the source (I expected all the stats to actually be IN the source, which in retrospect is a silly assumption).

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)Lithium Rain2011-04-19

> (...oh, I see the bad word now...sigh...)
.  "parse"?

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)Lithium Rain2011-04-15
. Go to tim_n's Member page and search for

<div class="statscard round-corners shadow" id="tim_n">

at the beginning of the data and

</div>

at the end


tim_n
Date Joined:Jan 5, 2007
  • Instructables26
  • Total Views265,680
  • Featured %65%
  • Subscribers50
  • Topics12
  • Comments197

Select as Best AnswerUndo Best Answer

user
Lithium Rain (author)NachoMahma2011-04-15

WHITESPACE!!!!!!!!!!!!!!!!!!!!1

Select as Best AnswerUndo Best Answer

user
DJ Radio (author)Lithium Rain2011-04-16

That's really glitchy in displaying it.

Select as Best AnswerUndo Best Answer

user
Lithium Rain (author)NachoMahma2011-04-15

This
Will
Be
Covered
So I'll be
Brief:
Cool!
Guess I
didn't
look
hard
enough.
:)

Select as Best AnswerUndo Best Answer

user
Jayefuu (author)Lithium Rain2011-04-15

It's a separate page thats loaded into your profile page, if you go to the page by itself you see all of the information as a table. All of the pretty formatting is done on your profile page.

I can't remember the link and I'm not at my pc, it's in the best answers script I wrote nacho though if you have or can get that.

Select as Best AnswerUndo Best Answer

user
Kiteman (author)NachoMahma2011-04-15

Did you deliberately add the card? Because it's covering the posts below (and a large part of this message asI type, so forgive any typos, please).

And, if you used that code on another site, wouldn't the card cover stuff there?

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)Kiteman2011-04-15

. I just did a C&P of the stat card HTML code (the stuff between the DIVs, inclusive) from tim_n's Member page. I doubt it will work without the proper CSS file(s) loaded, ie, off-site.

Select as Best AnswerUndo Best Answer

user
Lithium Rain (author)Kiteman2011-04-15

Haha, it depends. If you just SLAP IT UP THERE like certain people have done (ahem), it might, but you can position it however you want with html or css.

Select as Best AnswerUndo Best Answer

user
Kiteman (author)Lithium Rain2011-04-15

Ah, that would be code, then...

Select as Best AnswerUndo Best Answer

user
Lithium Rain (author)Kiteman2011-04-15

They tell me that's what the internet runs off of ;)

Select as Best AnswerUndo Best Answer

user
Kiteman (author)Lithium Rain2011-04-15

So why do I need to keep stoking my computer's boiler?

Select as Best AnswerUndo Best Answer

user
dombeef (author)2011-04-16
he he
V

dombeef
Date Joined:Jan 1, 3001
  • Instructables500
  • Total Views1,000,000
  • Featured %110%
  • SubscribersAll Members
  • Topics200
  • Comments50,000

_______________________________________________________ ___
_______________________________________________________ _____
_______________________________________________________ _______
_________________________________________________________ _______________________________________________________ _______
_________________________________________________________ __________________________________________ ___
__________________________________________________ _____ _____
_______________________________________________________ _______
_________________________________________________________ _________________________________________________________ _____
________________________________________________________ ___________________________________________ ___
_______________________________________________________ _____
_______________________________________________________ _______
_________________________________________________________ _____________________________________________________________

Select as Best AnswerUndo Best Answer

user
tim_n (author)dombeef2011-04-17

There's a man from the future here! Thus proving that an author on instructables will create the first authentic time machine. Shame it won't be for almost 1,000 years :(

Select as Best AnswerUndo Best Answer

user
dombeef (author)tim_n2011-04-17

Also in the year 3001 we found the fix to the problem of it going over other people's comments!

Select as Best AnswerUndo Best Answer

user
tim_n (author)dombeef2011-04-17

Fin!

https://www.instructables.com/id/Embed-your-Playercard/

Select as Best AnswerUndo Best Answer

user
dombeef (author)tim_n2011-04-17

Wow, nice job! I hope it gets featured!

Select as Best AnswerUndo Best Answer

user
tim_n (author)dombeef2011-04-18

Hasn't so far :( was hoping it would! But it looks nice on my website so I don't care! :)

Select as Best AnswerUndo Best Answer

user
tim_n (author)2011-04-17

We've done some coding and there is an instructable based on this here:

https://www.instructables.com/id/Embed-your-Playercard/

Please leave any comments/suggestions/bugs there please

Or you can go direct here:

http://playercard.neobard.net/

Select as Best AnswerUndo Best Answer

user
tim_n (author)2011-04-17

We're working on it - should be up soon! (just polishing off a few bits and pieces!)

Select as Best AnswerUndo Best Answer

user
tim_n (author)2011-04-16

Blimey, didn't expect to get so many replies overnight... now I've got to sort it out into a coherent stream of thought so I can understand who posted what and where (and try to uncover the secrets under my playercard...)

I have a coding friend over today, I'll ask him to have a looksie! (might make a nice wordpress plugin?)

Select as Best AnswerUndo Best Answer

user
Jayefuu (author)2011-04-15

I'll write you the php to scrape all of the stats if you or someone else writes the html/css to make the data pretty.... I enjoy php so don't mind doing that bit for you.

Select as Best AnswerUndo Best Answer

user
Lithium Rain (author)2011-04-15

Reply to nacho (but top-level so it's not covered up) - Cool! I'm totally wrong then. Shoulda looked harder. :D

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)2011-04-15

. The info is in your Your page (https://www.instructables.com/you/) or a member's Member page (eg, https://www.instructables.com/member/tim_n/). Use PHP or similar to extract and display as you wish.

Select as Best AnswerUndo Best Answer

user
Kiteman (author)2011-04-15

(Moved to "Authors>Help")

I bet there are quite a few people who like to be able to do the same thing.

Select as Best AnswerUndo Best Answer