How to get DA watchers count for personal website?

1 min read

Deviation Actions

KuldarLeement's avatar
Published:
6.3K Views
Hello internet - it's me again - Kuldar.

Does anyone know how to get watchers count from DA?

I wondered around DA API and realized that it can't do anything else than getting thumbnails from DA.
So I tought to use PHP and PHP Simple HTML DOM Parser:

$DA = file_get_html('kuldarleement.deviantart.com/s…);
$watchers
= $
DA->find('p[id=ViewsTotalDiv]', 0);
echo $
watchers;

but then I realized that DA load this info with javascript after it loads the page - I get everything else than gallery stats - shit just got real right?
It would be really cool if some of you know how to handle this problem - it's not something I need to now, but it would be cool to know how.
And i believe it would be helpful for somebody else too :)
© 2014 - 2024 KuldarLeement
Comments9
Join the community to add your comment. Already a deviant? Log In
Ghoul-Guyver's avatar
This is what I could find in the page source. it should be possible to have a script get this but I am a bit rusty on website stuff.

kuldarleement.deviantart.com/stats/gallery/ 

Page source 

deviantART.pageData={"artist_analytics_id":false,"userstats":{"id":9853532,"pageviews":169906,"deviations":324,"scraps":0,"commentsdeviations":2440,"commentsdeviants":1053,"commentsjournals":7,"commentsnews":3,"commentspolls":14,"shouts":0,"forum_posts":0,"comments_received":1824,"favourites":1257,"username":"KuldarLeement","gender":"m","subscribed":false,"since":"March 3, 2009, 11:19:20","friends":67,"friendswatching":8054,"comments":3517},

friendswatching is the bit you want.