Hey everyone!
Since I personally love having a little board of inspiration up sometimes, I always wanted a way to display many images at once, organized in a grid. I know the image handling is far from optimal, but it's the best I came up with for today.
Just put in the subdomain-name (name.tumblr.com), then the program will use wget (make sure you have it installed, I've attached it) to fetch the images.
Scroll through! :D
'Tumblr viewer
maxblogs = 50
maxpages = 5
INPUT "blogname: ", blogname$
b = b + 1
dontupdate = 1
maxb = b
PRINT "[" + CHR$(176) + longchar$
(" ", 9) + "] 0%"
b = 0
found = 0
b = b + 1
found = 1
url$ = "https://" + blogname$ + ".tumblr.com/"
formats$ = "jpg"
foldername$ = "view\" + blogname$
options$ = "-nd -rH -p -D64.media.tumblr.com -A " + formats$ + " -e robots=off " + url$ + " -P " + folder$ + "\" + foldername$
baseurl$ = "https://" + blogname$ + ".tumblr.com/page/"
pagecount
= 1:
DO: pagecount
= pagecount
+ 1 PRINT "[" + longchar$
(CHR$(219), (pagecount
- 1) / maxpages
* 10) + CHR$(176) + longchar$
(" ", (maxpages
- pagecount
) / maxpages
* 10) + "] " + LTRIM$(STR$((pagecount
- 1) / maxpages
* 100)) + "%"
formats$ = "jpg"
options$ = "-nd -rH -p -D64.media.tumblr.com -A " + formats$ + " -e robots=off " + url$ + " -P " + folder$ + "\" + foldername$
foldername$ = "view\" + blogname$
maximages = 500
columns = 5
pwidth = maxx / columns
autoscroll = 0
file$ = DiR$(spec$) 'use a file spec ONCE to find the last file name listed
posx(0) = pwidth * (columns - 1)
file$
= _STARTDIR$ + "\" + foldername$
+ "\" + DiR$
("") 'use an empty string parameter to return a list of files! i = i + 1
'IF image&(i) < -1 THEN
posx(i) = posx(i - 1) + pwidth
IF posx
(i
) > pwidth
* (columns
- 1) THEN posx(i) = 0
posy
(i
) = posy
(i
- columns
) + (_HEIGHT(image&
(i
- columns
)) * (pwidth
/ _WIDTH(image&
(i
- columns
)))) posy(i) = 0
_PUTIMAGE (posx
(i
), posy
(i
))-(posx
(i
) + pwidth
, posy
(i
) + (_HEIGHT(image&
(i
)) * (pwidth
/ _WIDTH(image&
(i
))))), image&
(i
) highest
= posy
(i
) + (_HEIGHT(image&
(i
)) * (pwidth
/ _WIDTH(image&
(i
)))) 'ELSE
' i = i - 1
'END IF
LOOP UNTIL file$
= _STARTDIR$ + "\" + foldername$
+ "\" OR i
= maximages
- 1 'file list ends with an empty string maxi = i - 1
'IF Taste$ = "a" THEN
' IF autoscroll = 1 THEN autoscroll = 0 ELSE autoscroll = 1
'END IF
change = 1
scrollpos = scrollpos + 1
scrollpos = 0
change = 1
scrollpos = scrollpos + (maxy / 10)
change = 1
scrollpos = scrollpos - (maxy / 10)
change = 0
IF posy
(i
) - scrollpos
< maxy
AND posy
(i
) + (_HEIGHT(image&
(i
)) * (pwidth
/ _WIDTH(image&
(i
)))) - scrollpos
> -1 THEN _PUTIMAGE (posx
(i
), posy
(i
) - scrollpos
)-(posx
(i
) + pwidth
, posy
(i
) + (_HEIGHT(image&
(i
)) * (pwidth
/ _WIDTH(image&
(i
)))) - scrollpos
), image&
(i
) '_LIMIT 60
CONST TmpFile$
= "DiR$iNF0.iNF", ListMAX%
= 500 'change maximum to suit your needs SHARED DiRCount%
'returns file count if desired STATIC Ready%
, index%
, DirList$
() IF NOT Ready%
THEN REDIM DirList$
(ListMAX%
): Ready%
= -1 'DiM array first use IF spec$
> "" THEN 'get file names when a spec is given index%
= 0: DirList$
(index%
) = "": ff%
= FREEFILE index% = index% + 1
DiRCount% = index% 'SHARED variable can return the file count
ELSE IF index%
> 0 THEN index%
= index%
- 1 'no spec sends next file name DiR$ = DirList$(index%)
FUNCTION longchar$
(char$
, length
) 'returns a string consisting of one character repeated (length) times temp$ = ""
temp$ = temp$ + char$
longchar$ = temp$