1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Rss feed to pinterest

Discussion in 'Pinterest' started by mfde69, Aug 18, 2014.

  1. mfde69

    mfde69 Newbie

    Joined:
    Nov 19, 2013
    Messages:
    39
    Likes Received:
    19
    Hi, I am looking for a way to automatic pinning from any of IFFT channels to specific boards.

    I am looking for something like delicious, where I bookmark to it then I have option to automatic posting to twitter. I need something similar for pinterest.

    I found viraltag but its 29$ a month.

    Thanks in advance

    edit: I mean pinning from rss feed, but I thought of using ifft, rss feed -> pinterest. But IFFT doesn't support pinterest
     
    Last edited: Aug 18, 2014
  2. Fortythieve

    Fortythieve BANNED BANNED

    Joined:
    Jun 8, 2013
    Messages:
    419
    Likes Received:
    70
    Looks like you need a bot
     
  3. mfde69

    mfde69 Newbie

    Joined:
    Nov 19, 2013
    Messages:
    39
    Likes Received:
    19
    No other way? I can't run much softwares on my pc and I wanted to set it up as "set and forget", as I wanna focus on other things.
     
  4. CodingAndStuff

    CodingAndStuff Regular Member

    Joined:
    May 6, 2012
    Messages:
    236
    Likes Received:
    84
    Occupation:
    Swagstronaut
    Location:
    You can't have my bots. Sorry :'(
    Here is the setup I'd run if I were you. Note: It uses my private Pinterest class, and I'm not giving it out, so unless you hire somebody to mimic the functionality it isn't going to work for you. Also, the implementation below is very hacky. 2/10 would not suggest replicating some of my POC coding practices.

    With this code (to you, pseudo code), you would structure your blog posts to have the same tag names as the boards you'd want them pinned to. From there it's pretty easy.

    Code:
    #Private for now. Sorry.
    import Pinterest   
    #pip install feedparser 
    import feedparser
    
    #Your RSS url - default on wordpress for RSS 2.0 is /path/to/blog/or/site/feed/ as reflected below
    rss_url = "http://mysite.com/blog/feed/"
    
    #Pinterest account information - Note: username can be username OR email
    pinterest_username = ""
    pinterest_password = ""
    
    #Open and read token.txt which contains our little access token
    def loadToken():
        return open("token.txt","r").read()
    
    #Save the access token to token.txt
    def saveToken(accessToken):
        f = open("token.txt","w")
        f.write(accessToken)
        f.close()
    
    #Make sure we're in the main function because yolo
    if __name__ == "__main__":
    
        #Instantiate a new Pinterest object
        pin = Pinterest()
        
        #Check to see if the access token is valid, otherwise login to the account
        token = loadToken()
        if pin.isValidToken(token):
            pin.setToken(token)
        else:
            if pin.login(pinterest_username, pinterest_password):
                #Save the token for later usage so we don't keep logging in/logging out and look suspicious
                saveToken(pin.accessToken)
            else:
                print "Could not login to account. Reason: %s" % pin.getLastError()
                exit()
        
        #Now that we're authenticated, we need to get our boards
        myBoards = pin.getMyBoards() #Store them in an array - it's also accessible as a public variable within the Pinterest object (pin.myBoards)
        
        #Fetch your RSS feed
        feed = feedparser.parse(rss_url)
        
        #Loop through posts
        for item in feed['entries']:
            post_url = item['link']
            description = item['description']    #probably a good idea to remove the htmlentities() stuff from here.
            content = item['content']    #Go ahead and parse out any images and put them in their own variable..we'll use "post_image" as the example.
            post_image = someImageParseFunction(content)
            
            #Now we loop through our boards and see if the board name matches up with any of our categories/tags for the post
            postBoard = None
            for board in myBoards:
                if board in item['category']:
                    postBoard = board['id']
            if postBoard == None:
                print "No boards match the tags..."
                exit()
            else:
                if pin.pinUrl(postBoard, description, post_image, post_url):
                    print "We successfully posted URL: %s to board %s" % post_url, postBoard
                else:
                    print "There was an error posting the pin. Reason: %s" % pin.getLastError()
        
        
    
    
    One last time to make sure it's abundantly clear. This will not work unless you have my Pinterest python class, which isn't available to the public (nor is it for sale). Sorry again.
     
  5. Fortythieve

    Fortythieve BANNED BANNED

    Joined:
    Jun 8, 2013
    Messages:
    419
    Likes Received:
    70
    Very nice code and share
     
  6. cnn8193

    cnn8193 Registered Member

    Joined:
    Oct 26, 2010
    Messages:
    96
    Likes Received:
    18
    Yeah, but completely useless.
    OP has just confirmed "This will not work unless you have my Pinterest python class, which isn't available to the public (nor is it for sale). Sorry again. "
    With that said OP has got something valuable which only he has got and it makes him very happy =)
     
  7. dirtyeyeballz1379

    dirtyeyeballz1379 Junior Member

    Joined:
    Jul 22, 2014
    Messages:
    173
    Likes Received:
    20
    try dlvr.it im 99% sure it has the pinterest auto poster your looking for. it has a paid and a free membership.
     
  8. CodingAndStuff

    CodingAndStuff Regular Member

    Joined:
    May 6, 2012
    Messages:
    236
    Likes Received:
    84
    Occupation:
    Swagstronaut
    Location:
    You can't have my bots. Sorry :'(
    I wouldn't really call it valuable. It took me like 2 hours to code in it's entirety. Any semi-competent programmer could even hook Pinterest's web api and make it work with the snippet I pasted above (which was the point of my post to begin with).
     
  9. kahuna74

    kahuna74 Regular Member

    Joined:
    Aug 19, 2014
    Messages:
    258
    Likes Received:
    96
    Gender:
    Male
    Occupation:
    Software Developer
    Location:
    Grand Rapids, MI
    Pinterest has an API? I've been doing a LOT of scraping with my bot written in clojure. Where are the API docs?
     
  10. CodingAndStuff

    CodingAndStuff Regular Member

    Joined:
    May 6, 2012
    Messages:
    236
    Likes Received:
    84
    Occupation:
    Swagstronaut
    Location:
    You can't have my bots. Sorry :'(
    Non-existent. :)