Multiple image tiles
-
Hello. I'm new to Pythonista. I'm working on a simple app that request data from a music api. What I want to do on my main view is show the image of the top 10 albums. I don't know how to implement this onto a view. My json data for the image uses a url. Is there a method that I can use to pass in the url the show the image? Can someone please give me a simple example of how to do this.
-
@ccc the url is
https://itunes.apple.com/us/rss/topsongs/limit=10/json
And I'm requesting the "im:image" url
-
@Webmaster4o sounds great. I'll try this ASAP. Also what if I didn't want a cover flow, I was thinking more of a table of images.
-
@ccc i would this the ui module would be more appropriate. Isn't scene and canvas more for a game interface?
-
Part I: Get the image URLs for the Top 10 iTunes songs:
import feedparser url = 'https://itunes.apple.com/us/rss/topsongs/limit=10/xml' def get_image_urls(itunes_url): for entry in feedparser.parse(itunes_url).entries: yield entry['summary'].partition('src="')[2].partition('"')[0] print('\n'.join(get_image_urls(url)))
-
Part II: Adds a ui.View... https://github.com/cclauss/Pythonista_ui/blob/master/TopTenView.py
-
@ccc wow! I didn't know it was so simple. Thanks for the sample code!!
-
@ccc one question. Where did you get the number 128 in the image_view.x and y?
-
It has to do with the spacing between the pictures. Try adjusting the value and seeing what happens.
-
This post is deleted!last edited by