RESOURCES

Below you find the copy of an etherpad in which I collected all sources I found interesting during research. All Statements and Questions can be found there as well. It's still accessible and open to everyone. Feel free to add resources if you think they fit into the thematic subject. >>link


Unspooked Art resources

Questions, Statements, Demands:

Whitecube and its ideology

Relevance of And purpose
Responsibility of Art
The New and the present




Reading Material:

Videos:


other Links:

Hashtags:

CODE

The instagram bot I used was Instabot.py by LevPasha >> link
I added two lines of code to the comment function of instabot.py so that it would log the media IDs of the posts it commented into a textfile.

            line 948    def comment(self, media_id, comment_text):
                                """ Send http request to comment """
                                if self.login_status:
                                    comment_post = {"comment_text": comment_text}
                                    url_comment = self.url_comment % (media_id)
                                    try:
                                        comment = self.s.post(url_comment, data=comment_post)
                                        if comment.status_code == 200:
                                            self.comments_counter += 1
                                            log_string = f"Write: {comment_text}. #{self.comments_counter}."
                                            self.write_log(log_string)
                                            with open("CommentLog.txt", "a") as f: #print the media ID to a textfile 
                                                print(media_id, file=f)
                                      


I then would use the unofficial Instagram API also by LevPasha to get the comments from the commented posts(i.e. the logged media IDs). As a foundation I used the example get_all_comments.py and modified it so that it would check if the posts are still existing and then check if there were replies to the comment made by the bot. If so the Comment thread would be saved to another textfile.

                
            with open("CommentLog.txt","r") as log:
                logLines= log.readlines()
            logLines = list(filter(None, logLines))
            logLines = [x.strip("\n") for x in logLines]
            print(logLines)
            noDuplicates= []
            for id in logLines:
                if id not in noDuplicates:
                    noDuplicates.append(id)
            logLines =noDuplicates


            count = 1000

            API = InstagramAPI("Username", "Password")
            API.login()
            #API.getUsernameInfo()
            has_more_comments = True
            max_id = ''
            comments =[]




            filteredThreads=[]
            for i in logLines:
                gestringt = str(i)
                has_more_comments:True
                _ = API.getMediaComments(gestringt,max_id=max_id)
                thread =[]
                print(i)
                usableURL = getInstagramUrlFromMediaId(int(i))
                print(getInstagramUrlFromMediaId(int(i)))  
                try:    #comments' page come from older to newer, lets preserve desc order in full list
                    for c in API.LastJson['comments']:
       
                        comments.append(c)
                        username = c['user']['username']
                        text = c['text']

            
                        if 'unspookedart' in username or 'unspookedart' in text:
                            #thread.append(username.encode("utf-8") +str(":").encode("utf-8")+ text.encode("utf-8"))
                            thread.append(username +str(":")+ text)

    
                    if len(thread) >= 2 :
                         filteredThreads.append("___")
                         filteredThreads.append(usableURL)
                         for x in thread:
                            filteredThreads.append(x)
            
                except KeyError:
                    print("oops")
                    pass
            print("done")

            with open ('Comments2.txt', 'w', encoding="utf-8") as f:
                print("\n")
                for y in filteredThreads:
                   # x = y.decode(encoding='UTF-8',errors='strict')
                    print(y, file=f)
            with open ('comments.json','w') as data:
                json.dump(comments,data, indent=4, sort_keys=True)
            time.sleep(5)


Afterwards another python script I wrote would go trough the comment threads and sort them by the first comment (the one the bot posted). All threads with the same first comment would then be saved into yet another textfile which again would be saved in different thematic directories.

                import time
                import os
                with open("Comments2.txt","r" ,encoding="utf-8") as comments:
                    allComments = comments.read()
                threads = allComments.split("___")
                print('BRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\n')  #don't ask
                singleThread =[]
                for i in threads:
                    singleThread.append(i.split("\n"))
         
          


                with open("QandD2.txt", "r") as QandD: #a textfile containing all questions and statements ordered by topic separated by "---"
                    QandDlist =QandD.read()
                topics = QandDlist.split("---") #split into the blocks of topics 
                print(topics)
                for y in topics:
                    singleTopic = y.split("\n") #split into the single lines/statements
                    print(singleTopic)
                    print("EYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY")
                    try:
                        os.mkdir("orderedThreads/"+str(singleTopic[0])) #the first element of each block is the thematic subject matter the statements belong to e.g. Whitecube
                    except:
                        print("EGAL")


                    for x in singleTopic:  #check which Statement the thread is about
                        if x:               #only compare to non empty strings of the QandAs
                            for i in range(1,len(singleThread)):

                                if x in singleThread[i][2]:
                                    print("BRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\n\n\n\n\n")
                                    filename = x.replace("?","...")
                                    filename = filename.replace("/", "###")

					
                                    with open("orderedThreads/"+str(singleTopic[0])+"/"+str(filename)+".txt","a", encoding="utf-8") as sortedComments:       
                                        for y  in singleThread[i]:
                                                print(y, file =sortedComments)
                                        print("___", file=sortedComments) 

            


From there on they get uploaded to my webspace manually or automatically with a python script using ftplib.
Finally the uploaded textfile mess I've made gets read by php and pushed into the form you can see browsing this page.
phew.

I know that is probably a very whacky solution and that It could have been done much simpler. The whole textfile system worked for me so I just sticked to it. Please feel free to give me advice on how to do it better (mail[at]pcis.life). I promise I will make a github account soon too.