๐ŸŽ‰ Happy 19th Birthday to Danbooru! ๐ŸŽ‰
Danbooru

New post feed with favorite artists?

Posted under Bugs & Features

impulse_eye said:

Is it possible to access my own favorites list?

You mean this? http://danbooru.donmai.us/favorites
This is linked in the subnavbar (it's between Hot and Favorite groups).

If you want the json version it's just http://danbooru.donmai.us/favorites.json

Alternatively, you can also search for fav:impulse_eye or ordfav:impulse_eye.

impulse_eye said:

I don't see this listed anywhere on the API page.

I updated help:api with information on the favorites api.

impulse_eye said:

Upon searching I found reference to this:

http://danbooru.donmai.us/favorite/list_users.json

but it doesn't seem to work.

Where did you find that?

Toks said:

Where did you find that?

That was actually on the Konachan API page. I assumed there would be something similar.

But thanks, that essentially gives me what I need to make this work. This JS will grab your favorites list one page at a time, dump all of the IDs, and build and print a set of all artists you have favorited:

Show
<!DOCTYPE html>
<html>
<head>
	<script src="jquery-2.1.4.min.js"></script>
	
	<script>
		//jQuery success callback
		function onReceived(data, status, xhr)
		{
			//if result is empty, we have reached beyond the last page
			if(data.length === 0)
			{
				printFavorite();
				return;
			}
		
			for(var i=0;i<data.length; ++i)
			{
				document.write(data[i].id + '<br>');
				var a = data[i].tag_string_artist;

				//Ignore posts with no known artist, i.e. do not put
				//blank/undefined in the artist set
				if(typeof a !== 'undefined' && a.trim() !== '')
					favoriteArtists[data[i].tag_string_artist] = true;
			}
			
			queryPage();
		}
		//jQuery error callback
		function onError()
		{
			alert("AJAX GET error!");
		}
		
		//query the current page
		function queryPage()
		{
			$.get("http://danbooru.donmai.us/favorites.json?page=" + crntPage, {}, onReceived, "json");
			++crntPage;
		}
		
		//build the set of all favorite artists
		var favoriteArtists = {};
		//remember which page we are currently on, so it is accessible in the
		//onReceived callback
		var crntPage = 1;
		
		function printFavorite()
		{
			for(var a in favoriteArtists)
				document.write(a + '<br>');
		}
	</script>
</head>
<body>
	
	<script>
		//start by querying page 1, then upon completion query the next page until
		//there are no results
		queryPage();
	</script>
</body>
</html>

So the favorites list uses the same parameters as searches, where limit specifies page size, and page specifies page number. I also didn't see it listed anywhere on the API page, but the request returns an empty array when you reach beyond the last page.

Results:

Show

439583
1611537
1740384
2055000
501872
327668
284505
205900
184927
163786
163787
166000
166005
163788
163784
2033806
1915983
1818521
1752883
1798641
1670997
1654397
1131896
427586
1727161
1965924
1423746
1871142
736862
1495227
1426188
1399352
1496919
1543901
764505
764178
2053183
1545580
962082
1223213
1898674
1198486
1175311
1181570
2032969
1076346
1475263
1949651
2022952
2007148
891092
262280
344664
1592927
1966938
1285491
1791514
1791513
621699
803546
819533
1161879
899079
1005622
1366497
1332790
1490521
976504
205798
275180
894188
1953386
1643104
1368839
1953402
186521
698522
565325
623830
715865
666254
1012387
1100928
1248352
1343026
1457751
1907716
2013859
1970822
1976579
2005645
2027783
32940
1942736
1524913
1912199
2022913
2022917
2013071
2002072
969967
1304218
1873812
1887884
1927804
1935047
705584
1383116
512980
1965147
1862237
1767322
1736229
1595147
1469941
1904801
163793
787341
815600
629257
634429
715157
1008361
1780071
1925505
2013989
1143903
1972906
1023902
1364818
1573083
1972903
1991647
1680157
1675178
1002366
1269984
1392556
1668187
1807152
799226
1463446
1941475
1995977
1426717
1996711
1989791
102523
1127866
1877216
1993071
1846538
1718760
650693
1422587
1773843
734519
734379
734350
538359
734321
1270640
862253
1063634
837626
812744
418060
580820
838945
1576517
575071
816192
816172
396983
694844
1148
287908
326935
1896314
1912009
1912020
1987577
1969096
1579955
1495453
1319427
1867370
1096246
897311
1982411
1981453
957491
1980472
1980466
1699977
1064313
1074399
1280171
934720
978975
1918118
729870
1196978
1269613
1712960
332959
499435
25368
1391913
1898207
1919230
1924816
1268067
1925050
1957181
1934427
1931769
1053188
1262082
575563
870351
1141443
597797
437044
1683731
1725566
1717885
598189
598193
1292584
1817300
1308392
1323825
1324578
1356954
1343463
1602441
1625934
1616002
1626117
1702021
1081448
515354
1757823
321695
193692
538654
725517
1114900
410555
647533
916026
1547537
1315524
1455600
1553363
1884338
310419
1630465
1849183
1430309
1863234
1640014
1685900
899740
925093
944568
1872965
1873828
1030463
835865
859323
1842403
689025
1726328
277488
1577309
1782560
1660993
1692861
1710016
1794979
1815524
940751
1203760
1101385
1119048
1117002
420306
475361
530161
294775
608808
1236860
924027
1270684
805642
266341
857406
1849936
1177652
1187882
1074402
1074340
979857
979858
1759455
1759457
1843058
1780419
1752136
900336
1688756
1661571
1598817
1498541
1393531
1439629
1471459
1858343
1487102
1387487
1409362
548826
140155
621249
1188870
533166
509751
1139364
1063818
489117
761893
1100206
439608
417085
574554
604619
598186
608179
624761
732750
1813582
1225814
1026432
1205553
919143
425286
1830103
1830455
1830319
1830576
1836924
1835794
1844393
1854626
1854731
1878146
1878164
1523237
1230007
531426
511541
702984
816418
885287
1273932
565305
912198
916842
702466
681738
987346
937670
915371
679996
184104
601783
831713
829784
tokoroten_(hmmuk)
dorowa_no_hito
morino_hon
des
ebi_193
noya_makoto
nihimaru
yu-kun
kamonari_ahiru
mujiha_(mlog)
akisha
danna_(karatekikku)
gorilla_(bun0615)
nanana_(chicken_union)
tamashii_yuu
megumiya
ramble12
reina_(black_spider)
six_(fnrptal1010)
gaoo_(frpjx283)
kuresento
yukari_yukke
aki_sakura_(ikokoro)
matty_(zuwzi)
pom
golden_pe_done
kty_(04)
watanore
nori_(arinomamani)
naobe009
munya
hyuuga_azuri
jyako
tkln
hikarumiao
joey_hanma
kuri_youkan
colonel_aki
warabi_mochi_(ehimedaisuki)
niiko_(gonnzou)
yohane
itohime
onikobe_rin
hammer_(sunset_beach)
chamupei
totto
meito_(maze)
kitou_kaitai
kazawa_(tonzura-d)
harusame_(unmei_no_ikasumi)
drawfag
nanashii_(soregasisan)
bon_(rump)
dai-erie
tsuno_no_hito
to-hou_eiyasyou
haisawe
bebeneko
koshibata_zekuu
fuuko_chan
gennsuikyou
ema20
tsukumizu_yuu
minathuki
innocent_key
rebecca_(keinelove)
nekoha
kyouran
haruki_5050
miyo_(ranthath)
ichimi
black_burakku
maruki_(punchiki)
gaius_(nikoniko2)
yuasan
eiri_(eirri)
ominaeshi_(takenoko)
s-syogo
sinzan
fenikkusu_takahashi
gyo
drachenriese
alison_(alison_air_lines)
genshi_shin'ichi
waribashi-p
st.kuma
douji
herada_mitsuru
yuki_shizuku
kakinoki_mikan_(kari)
chinoru
pila-pela
wakagi_repa
kaiza_(rider000)
eno_(whiskeyne)
kugi_(kugi-xiv)
dokuta
poka
ototarou
ebizome
untan
bococho
binayu
tsuzuri_(tuzuri)
mow
koto_inari
ibarashiro_natou
ichiba_youichi
shinapuu
shope
karaagetarou
yuzuna99
rinmei
kotobuki_(stealth_sendan)
hakkotsu_shitai
mofu_mofu
loggy
fuuen_(akagaminanoka)
neropaso
kasagi_shura
wata
yoriyuki_chiyo
nagi_renma
nanamomo_rio
mendou_saya
senhaku
umarutsufuri
tendo_(zhazhatiantong)
kue
karamoneeze
unya
berabou
aki_(yuzuriha)
toyomaru
aaaa
tani_takeshi
takasegawa_yui
tri
yug
minato_hitori
angeltype tagawa_gengo
gatau
warugaki_(sk-ii)
puuakachan
mizuki_hitoshi
kokujuuji
futa4192
masa07240
himamushi_nyuudou
tenko_(gintenko)
mitsuki_yuuya
gahiro
kazami_ruku
dodomakunaru
takadoya
geshopu
komimiyako
hounori
kachayori
furukawa_(yomawari)
aratami_isse
fukaiton
jin_rikuri
mashayuki
meth_(emethmeth)
jiryuu_(time_tide)
witoi_(roa)
gigokku
suiryoku_nozuru
yakumo_nanahara
zuizou
efe
tatsumoto
kurogarasu
nukosama
yuka_yukiusa
yuichiitan
ueda_john
yasume_yukito
misawa_hiroshi
jinnouchi_akira
suzushiro_yukari
kuromu_(underporno)
77gl
akai_ronii
kuro_minamo
kuronuko_neero
shimo_(depthbomb)
catstudioinc_(punepuni)
koma_(remi_398)
maullarmaullar
rinkashline
girotin_ginza
rokunen
kongari_(kngr)
givuchoko
kurokoori
wool_(miwol)
berutasu
eichi_yuu
nip_to_chip
be_(o-hoho)
satorichan
noai_nioshi
tori_(minamopa)
tori_(hiyoko_bazooka)
yamazaki_mitsuru
kujira_lorant
subaru_noji
akasode_(tyaramu)
yokochou
masara
kintaro
potaaju
maiku
hino_ryuu
kotomuke_fuurin
soubi
ishikawa_yuga
spark621
tonoa
toor_0111
moegi_nenene
razy_(skuroko)
kirbym walfas
yamabuki_(yusuraume)
kishiri_(sakurasaku_xyli)
mutsumi326
amakoke
namamo_nanase
kaze_(kazesan)
miruki
elu_butyo
reishen
kobedenshi
muyue_mitsudou
nobamo_pieruda
ryo
mashima_(sumachi)
kuro_suto_sukii
chiyo_koharu
nakatani
chikado
monikano

impulse_eye said:

What is the best way to query recent posts via the API?

What type of recent posts?

For posts recently uploaded to the site in general: /posts.json
For posts recently uploaded under a specific tag: /posts.json?tags=inserttaghere
For posts you recently favorited: /favorites.json

Today, after a long while, I wanted to browse some of my older favorites.

I had vague memories of fastfav and a couple of other tricks, but they did not seem to work any more, not in the way I wanted them to anyway.

It took quite a bit of effort to find the ordfav metatag, largely because I started in the wrong places.

Now I have expanded help:favorites. My main goal was to include a mention of ordfav, but I also added a mention of unfavoriting and a few headers.

Would it be okay to mention that ordfav is the only way to jump over pages while browsing favorites?

Katajanmarja said:

Would it be okay to mention that ordfav is the only way to jump over pages while browsing favorites?

If you are talking about the API: not true, favorites.json allows you to specify page number as GET parameter, just like posts.json.

1