would it be possible to write a plugin for this website? www.deviantart.com
there is no public API. if you think it’s possible, including search and login, i would like to give it a go.
i never wrote anything for a computer in my entire life. i know about it as much as you might know persian. i am willing to give it a try though. if you think i could tackle it tell me. i don’t wanna invest TOO much time though.
thanks
a picture plugin, that is 
من فکر می کنم این امکان وجود دارد
… hohohohoho
yea ok you might know persian, still doesn’t make me know how to write plugins 
help!
I think there is a possibility – using babylon helped me too. however, unluckly there is no english <-> python translator. care to help? 
All I can say is this; A number of active plugin writers, myself included, knew no python, nothing about on-line video, audio, etc when we started writing plugins. We wanted to see some of our favorite content in Plex so, instead of waiting, and pleading, for other developers to do it, we looked on-line, read some articles, maybe bought a book, looked at the source code of existing plugins, and wrote them ourselves.
It’s not that hard, and if you get stuck people will help. They are just more inclined to help if you actually try first rather than just saying ‘can you do it for me please’. Just look at the recent thread by MTI in this forum for a great example of just that.
Jonny
i know, and i agree with you. but between having to move to a different flat, writing a masters thesis on lupus (do you watch House?), and soon entering my 5th year of medical studies, also having to cook, sleep, and leaving some time for my girlfriend (how generous, aren’t i?
) and maybe wanting to watch one or two of the 500 films i have on plex, there is no possibility for me to find time for this. not now, not in near or distant future. buying a book & trying to learn python until i can finally write my own plugin seems rather utopian to me. i say utopian because it would be the ideal solution, but it’s never gonna happen for me.
that’s a pity, because i really really wish i knew how to write. i want one of those disks from the Matrix movie with “Python” uploaded into my brain, so i can start writing right off. but other than that, no sir, not for me.
to MTI and all of you, enjoy & thanks!
edit: the thing is that i have really (maybe it’s hard to imagine) no imagination at all when it comes to writing. if i DO try to write it, how long do you think it would take me? a weekend? a month? longer? less? just so i get the picture of how hard it is. in my original post i did say i wanna try it myself. 
Like Jonny said, I started out knowing nothing. I only had a couple of programming classes in high school & college. (Pascal and C+)
I started by looking at other plugins, and trying to understand how they worked. Then I used the internets & Plex forums.
I just picked a Python book up at the library.
i’m no expert, but I definitely feel comfortable trying to tackle any plugin that I would like to use on Plex.
And, with all due respect, I think you do have time. Look at all the chat posts you make…
as far as time…
I think you could whip something usable out in a day or two (maybe even a few hours)
yup i have holidays now for 2 more weeks… that’s why i was hoping to try n write it now. but i hav eno idea if it will take longer than that. after that it’s back to reality.
i am this forum for almost a year but you haven’t heard much of me a few weeks ago, right?
yup, because i was busy. 
I understand the time constraints man. Having written a PhD thesis before, currently working for small drug discovery startup, just got engaged and training for the death ride to raise money for cancer research. That said, I find plugin writing a good way to relax. It’s so far from everything else I do, they are small and self-contained, and you get very immediate feedback on what you are writing. All that makes them fun to write and if you are scratching an itch all the better. You need to dive in to find out.
All that said, if you pick an easy source to parse and simple functionality, it’s a few days from start to finish. For example, the recent IMDB plugin one took me literally an hour. That’s cos I know what I’m doing (most of the time) of course, but that gives you an idea of what’s involved for an easy one.
Jonny
Pooploser,
Take a look at the ABC (US) plugin from my REL 5 US Plugins thread. Also check out the source code for the website you want, as well as the source of http://abc.go.com/watch/shows, which is the website ABC pulls from initially. Yes, one’s a picture and another is a video. Don’t worry about that. Get comfortable just looking at the code and seeing any similarities between the websites (
Harley
ok i’m slowly getting it…i wanna get the menu working first.
i’m trying to connect the div class with the div from the main menu on the page.
there it’s this:
<div id="facetMenu-Category" class="sliding-menu " ><br />
<div class="noncollapseHeader">Category</div><br />
<ul id="categories_art"><li> <ul id="facetMenu-Category_list"><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/digitalart/">Digital Art</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/photography/">Photography</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/traditional/">Traditional Art</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/film/">Film & Animation</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/contests/">Contests</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/customization/">Customization</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/artisan/">Artisan Crafts</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/designs/">Designs & Interfaces</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/cartoons/">Cartoons & Comics</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/manga/">Manga & Anime</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/fractals/">Fractal Art</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/literature/">Literature</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/gameart/">Game Development Art</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/flash/">Flash</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/resources/">Resources & Stock Images</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/fanart/">Fan Art</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/anthro/">Anthro</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/projects/">Community Projects</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/darelated/">deviantART Related</a></li><br />
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/scraps/">Scraps</a></li><br />
</ul><br />
</li></ul> </div><br />
<br />
i have this in the plugin, but nothing shows up:
def MainMenu():<br />
pageUrl= DEVIANTART_CATEGORIES<br />
dir = MediaContainer(mediaType='items')<br />
content = XML.ElementFromURL(pageUrl, True)<br />
Log(content.xpath('//div[@class="sliding-menu"]/a'))<br />
for item in content.xpath('//div[@class="sliding-menu"]/a'):<br />
Log(item)<br />
title=item.get('title')<br />
titleUrl = item.get('page')<br />
thumb=item.xpath("img")[0].get('src')<br />
summary=item.get('desc')<br />
Log(titleUrl)<br />
Log(thumb)<br />
Log(title)<br />
Log(summary)<br />
if titleUrl.count("afv---") !=1:<br />
dir.Append(Function(DirectoryItem(ItemPage, title,thumb=thumb, summary=summary), pageUrl = titleUrl))<br />
return dir <br />
any ideas?
You need to be explicit in your case:
1. change "sliding-menu" to "sliding-menu " <- If you don't want the spaces in you parentheses, there is a function called contains that you could use, but this should work fine.
2. change '//div[@class="sliding-menu"]/a' to '//div[@class="sliding-menu"]/ul/li/ul/li/a'
Just as a note, re the earlier discussion on this thread. I have no problem (at least right now) walking people through their first plugin. I understand how intimidating it can be. If it means more plugin devs, I will help out up to but not including writing a plugin for someone. My approaches aren’t the most graceful, but I would love to have more devs out there. And programming in public like this will be a great way to help out those searching for how to write other plugins too.
yea, that’s what i agree with. thanks very much for your patience and everything.
i changed those two things, but while earlier it would open an empty main menu, the plugin doesn’t open at all now. i’m going step by step by the way, replacing stuff in your existing ABC plugin. this is what i got so far:
(ignore the art&thumb, i’ll do that last, it’s the easiest bit.
<br />
# PMS plugin framework<br />
import re, string, datetime<br />
from PMS import *<br />
<br />
##################################################################################################ABC<br />
PLUGIN_PREFIX = "/photos/deviantart"<br />
<br />
DEVIANTART_URL = "http://www.deviantart.com/"<br />
DEVIANTART_CATEGORIES = "http://www.deviantart.com"<br />
<br />
DEVIANTART_FEED = "feed://backend.deviantart.com/rss.xml"<br />
DEBUG = False<br />
abcart ="art-default.png"<br />
abcthumb ="icon-default.png"<br />
<br />
####################################################################################################<br />
<br />
def Start():<br />
Plugin.AddPrefixHandler(PLUGIN_PREFIX, MainMenu, "Deviantart","icon-default.jpg", "art-default.jpg")<br />
Plugin.AddViewGroup("InfoList", viewMode="InfoList", mediaType="items")<br />
<br />
MediaContainer.art =R(abcart)<br />
DirectoryItem.thumb =R(abcthumb)<br />
<br />
####################################################################################################<br />
#def MainMenu():<br />
# dir = MediaContainer(mediaType='items') <br />
# dir.Append(Function(DirectoryItem(all_shows, "Categories"), pageUrl = DEVIANTART_CATEGORIES))<br />
# return dir<br />
<br />
####################################################################################################<br />
def MainMenu():<br />
pageUrl= DEVIANTART_CATEGORIES<br />
dir = MediaContainer(mediaType='items')<br />
content = XML.ElementFromURL(pageUrl, True)<br />
Log(content.xpath('//div[@class="sliding-menu "]/ul/li/ul/li/a'))<br />
for item in content.xpath('//div[@class="sliding-menu "]/ul/li/ul/li/a'):<br />
Log(item)<br />
title=item.get('title')<br />
titleUrl = item.get('page')<br />
thumb=item.xpath("img")[0].get('src')<br />
summary=item.get('desc')<br />
Log(titleUrl)<br />
Log(thumb)<br />
Log(title)<br />
Log(summary)<br />
if titleUrl.count("afv---") !=1:<br />
dir.Append(Function(DirectoryItem(ItemPage, title,thumb=thumb, summary=summary), pageUrl = titleUrl))<br />
return dir <br />
<br />
####################################################################################################<br />
Your number 1 friend while programming is the Console app inside of Finder->Utilities. Scroll down to com.plexapp.plugin.name of plugin.log. If there is an error, there will be what’s called a traceback event. Check to see if there’s an error anywhere.
i did that already hehe
but no, nothing, shows no errors, says “response ok”.
by the way, i just wanna describe how the menu works:
on the left you choose the category, then a new page will be opened, and with sub categories in the left menu. clicking that again, another sub menu will appear… maybe try it out a lil, so you get what i mean. hitting one of these main menu items shouldn’t display pictures but another submenu list. help lol
selecting the 2nd submenu would show you the rss feed of the pictures.
that’s how it would/should work. i don’t think it’s hard, if i had only a clue…
I got an error about the thumb=blahblahblah line. let’s change this:
<br />
Log(item)<br />
title=item.get('title')<br />
titleUrl = item.get('page')<br />
thumb=item.xpath("img")[0].get('src')<br />
summary=item.get('desc')<br />
Log(titleUrl)<br />
Log(thumb)<br />
Log(title)<br />
Log(summary)<br />
if titleUrl.count("afv---") !=1:<br />
dir.Append(Function(DirectoryItem(ItemPage, title,thumb=thumb, summary=summary), pageUrl = titleUrl))<br />
return dir
to
<br />
Log(item)<br />
title=item.text # This grabs the text between the tags<br />
titleUrl = item.get('href') # get function grabs attributes inside of a tag such as href or class<br />
<br />
Log(title)<br />
Log(titleurl)<br />
if titleUrl.count("afv---") !=1:<br />
dir.Append(Function(DirectoryItem(ItemPage, title,thumb="", summary=""), pageUrl = titleUrl))<br />
return dir
the main problem i have right now lies here:
<li><a style="padding-left:30px;" href="http://browse.deviantart.com/traditional/">Traditional Art</a></li><br />
i don't know how to make it read from that.
i tried this
title=item.get('desc')<br />
titleUrl = item.get('href')<br />
href is defined in there, but there is no desc="Traditional Art" or whatever. my html sucks.... how can i make it read the titles?
it still gives me an empty main menu.
this fills the menu for me:
<br />
for item in content.xpath('//div[@class="sliding-menu "]/ul/li/ul/li/a'):<br />
Log(item)<br />
title=item.text <br />
titleUrl = item.get('href') <br />
<br />
Log(title)<br />
Log(titleUrl)<br />
dir.Append(Function(DirectoryItem(ItemPage, title), pageUrl = titleUrl))<br />
return dir<br />