Showing posts with label Humor. Show all posts
Showing posts with label Humor. Show all posts

Monday, April 6, 2015

Python Twitter Bot with Tweepy

In an earlier post I laid out a bit how I was working on a twitter bot to automate the promotion of this blog.  I'm a slacker, that has a bad rap for many folks, for me it's the highest calling I can aspire. Get the most accomplished, with the least effort, and disturbance. In the words of Bruce Lee, "Be Like Water, My Friend".  In the dao of piglet, and the te of poo, it's the mystery of being the uncarved block. In the teachings of the Kabbalah or Quabbalah, which was made into such nice easy pictograms in traditional tarot, it's learning to be representative of any, while maintaining your own sense of self.  I have one Boss, and I'm really hoping that Boss never shows up, but I always am sure to recognize There is always a bigger fish. When I crashed the party of social media a few years back, it was never intended to a social outlet. I had already experienced that in years of mmorpg's, irc, bbs, going back to wargames dialers, and phone phreaking. What I was always best at was social hacking, a rather disturbing art when taken to the level of social engineering, or mass media marketing.  After all the drugs, meditation, and study I did over the course of  a lifetime, I finally started to see a pattern, it's not even an unknown pattern, matter of fact it's all over the place, or at least portions of it are.  When I finally awoke to what I had been attempting to understand, about people, and their place in creation, I found that I had missed the relative short window of opportunity to be counted among those who's say carried any weight. In social media I saw an opportunity to leverage the flood of information as a means to get ideas running through my mind. into the hands of those who could make use of them.  I accidently crashed the party of the twitter follow gangs, that handle the bulk of the twitter advertising. It's a fairly ingenious method of leveraging the split platforms of twitter, and sms, in concert to trade influence in the twitter verse. I just saw it as an expedient means of sharing ideas to everyone as quickly as possible, regardless of how they were accepted. I even refused ever offer of easy income, not out a disdain for the finer things the world has to offer, but from an understanding of the myth of an infinite growth paradigm in a zero sum game. I'm speaking of the effects of compounding interest on privatized currency creation. The same effect is seen again and again in almost every market. It's the money itself I have issue with, not currency as an idea. The accounting for who has what, and why, is important. In our current system so many are being left behind, not out of ability, but just by becoming a party to the madness which has a seeming strangle hold on our global civilization. The worship of money, and idol, a representation of something only in potential.  As I said I'm an old school hacker, I once streamlined a system for reporting the percentage of the utilities used in manufacturing in New York state were taxable.  Was a great job while it lasted, at 18 having a work from home job for 10 or 12 an hour is amazing. Taking the time each reports takes to generate from 6 hours to 2 hours, and being told your services are no longer required, not so amazing. Being allowed to help a crop of Police Officers pass a class they had no reason taking, Amazing!. Having your professor tell you there is no place in the world for programming games, again not so amazing. I stopped using computers, and started playing games with them, and then started fixing them.  In the course of my several years of tech service for a local community, what I found was they didn't actually want for me to really solve the issues, they wanted me to manage the problems that cropped up with using outdated, or mixed era systems. Sometimes they almost wanted me to take over the day to day operations of their endeavors. All well and good if it is a mentor situation, when it's a lack of desire to stay current enough to manage your own affairs, well if your not the adult, there aren't many roles left.  After exhausting some of the more entertainment oriented uses for the raspberry pi b+ I turned to what else could this little marvel do. I started seeing vpn's, and pirate drop boxes, wifi extenders to create public clouds all over. All cool concepts, but not much use to me personally, given my current circumstance. Realizing I needed to have a bit of programing brush up, I think the last time I wrote code before this was 88 or so. I hit up code academy, and picked python as it is a seemingly popular high lvl language with many popular api's. I also did some html work, I get it, and it's powerful, it's just puts me to sleep doing it. Even in python as entertaining as it was to create the bot as far as I've taken it, and I am well aware how limited it is in it's current state.  It's basic, but it will tweet for you, pick from search terms to promo others, so your account generates more attention from the community, and will auto follow new folks, and unfollow those that are just attempting to boost numbers. Once I got there essentially I had a automatic twitter promotional bot. Did you know people get paid for doing promotional work on twitter? Even though it makes sense from the marketing game standpoint, that is a slippery area, we are talking about folks that have no moral issue with using psych jobs on children to profit.
So today I'm going post the code for my bot friend. working title was twitternanny, but for easy of use I have taken to naming them after the account they manage. I currently have 2 instances running on my raspberry pi. They may come down at the end of the month, as I have already given notice, my leap of faith I guess, with no place on horizon as of yet. I guess I could always battery power it, and stick in an open wifi cloud in a tree or something, but what would be the point. I ended up using twitter as an object lesson of the insanity of exclusivity.
Enough of my ramble, I get sick of myself sometimes.
here is the code, use it abuse it.



def hourlytweet():
    filename=open(argfile,'r')
    f=filename.readlines()
    filename.close()
    api.update_status(status=f)
    print("hourly tweet posted")


def follow_unfollow():
    followers = api.followers_ids()
    friends = api.friends_ids()

    for z in followers:
        if z not in friends:
            api.create_friendship(z)

    for z in friends:
        if z not in followers:
            api.destroy_friendship(z)
    print("follow, unfollow done")


def search_retweet():
        search_terms= ['python', 'technology', 'raspberry pi', 'ingress', 'news', 'breaking']
        g = random.choice(search_terms)
        g = '#' + g
        results = api.search(q=g, count=1)
        for u in results:
            if u not in alreadytweeted:
                api.retweet(u.id)
                print("retweeted top result for", g)
                alreadytweeted.append(u)



x=1
y=2

while x<y:
    localtime = time.asctime(time.localtime(time.time()))
    hour = int(localtime[11] + localtime[12])
    print('current hour is:',hour)
    if hour>5 and hour<24:
        try:
            hourlytweet()
            time.sleep(1700+random.randint(200,400))
        except:
            print("could not post hourly tweet")
            time.sleep(1700+random.randint(200,400))
        try:
            search_retweet()
            follow_unfollow()
        except:
            print("could not post retweet")
    elif hour == 24 or hour < 6:
        try:
            search_retweet()
            follow_unfollow()
        except:
            pass
    time.sleep(1700+random.randint(200,400))

some of the basic framework came form http://www.dototot.com/how-to-write-a-twitter-bot-with-python-and-tweepy/
So big ups and respect, thanks for the head start, and to those I didn't mention, sorry I use many reference sources when I start a little project.

Thanks
Jack
aka
PanseyBard Digital PiedPiper

Tuesday, January 21, 2014

Who or What do You Think You Are?

            I guess this is one of the questions almost everyone has or will ask themselves at some point.  What I find most entertaining is while who might at first glance be tough question, our understanding of the nature of reality may have made what the more confusing.  That being said many will never get past who, so I'll start with my take on who we are in general sense, before I attempt a prod at the what.

         Who am I, might seem pretty easy, I mean I have an identity I use on a daily basis for others to refer to.  So I have a name I was given at physical birth, and to one degree or another I identify with this name. In my case I refused to even answer to my given name till middle school.  With a name like Jack can you blame me?   Some of you might be wondering whats wrong with the name Jack?  It isn't that there is something wrong with it, but when you start to look a bit deeper in the meanings and effects of names on the psyche, and even down the physical your perception of it might alter.  At this point I'd like to direct you to the work of Dr Masaru Emoto. Is it really such a leap to apply that to your name and the water of your body.  Everyday people call you by a name, this name carries with it an form.  The form, or energy carried by your name patterns you without your even knowing it.  Every name has entangled in it the history of that named being used over and over.  Things like the numerology of a name takes on new meaning the numbers telling a story of the energy contained, and the overall effect a particular name carries.  In the case of my given first name it would be something like this,  10 1 3 11, in the most widely used western numerology this would be added as individual numbers to come with an overall energy of the name. Looking something like this 1+0+1+3+1+1=7, so the over arching energy would 7.  This of course is just one aspect, another is ideas presented by Synchromysticism.  Applied to names, and assuming the interaction of the energies present and Jack becomes an identity that perhaps some would find tough to assume. All of this also relies on a thread to be woven through history, a running narrative extending back into antiquity, and forward off into infinity. Some would argue that there is no linkage that can be identified that warrants these ideas be anymore then speculation.  I say we are link, we write the stories, we become the tapestry linking them all.  How does this all add up to who I think I am?  Well to put it simply, I am a work of fiction.  As one of my favorite t-shirts states "fictional character".  I'm not sure a more true representation of our condition can be found, I have a running narrative, containing the character I am currently playing.  My conception of self is less important to you, then your concept of me.  So I don't even have a set identity, who am I changes as the way those around me perceive me changes.  Even my sense of self identity relies on the culture I find myself in, just try to describe who you are without using other people, things, or events.  As strange as our sense of identity might be, it pales when compared with what we are.
          What we are becomes so much a matter of perception, and the deeper you look the stranger we seem. Most medical doctors will say we are mostly water, while most physicists will say your mostly empty space.  Both are correct when looked at from their respective perspectives.  When you keep going down the rabbit hole into the realm of quantum the fun really begins. Suddenly the fact we are as paradoxical as the idea of particle or wave becomes so self evident as to defy what most consider rational explanation. As it turns out we are an illusion, a trick of the senses, think seeing is believing.  we appear solid, though we know there is nothing solid we can find. Even our perceptions are as easy to change as clicking the remote to switch channels.  Our senses so easily fooled, yet trusted implicitly. When was the last time you stopped to consider how your senses function, how what you perceive isn't exactly a lie, though it's only accurate from a human perspective. When was the last time you thought about how your "senses" function, or even questioned the limits we are given on the senses. How many senses do you even have? this might seems silly but this video from the Animaniacs points out the limit of 5 senses isn't even accurate.  The view we are a classical system made up of quantum components may be one of the most accurate I've seen to date, it may even hold the clue to the interface between mind, body, spirit through entanglement.  So what am I? Does it even matter?  I and no one else can answer these questions for you, all anyone can do is give the answers that work for them.

Jack
aka
PanseyBard

Saturday, December 28, 2013

Ramble On

         Today lets talk eternal, what that actually means.  First off I defer to great thinkers through out time both religious and secular.  So many have reported some sort of continuation beyond what we think of as physical death.  If we are talking a purely energetic transfer, where what we think of as us ceases when our body stops functioning we can end the thoughts right now.  If on the other hand there is a bit more of us that continues on this journey of existence other questions spring forth.  How about even the Idea that energy can not be created or destroyed it can only be transformed.  Taken to an extreme that would mean all things that exist now, have in some form or another always existed, and will always exist.  That there can be no beginning or ending, there would be only transition, one state or phase endlessly shifting to another.  There are so many questions of the why's and how's.
       I want to think a bit about what it means from an individualized portion of self. Not a being that identifies with a single name, but one that has been so many names and is in all likely hood experiencing all these names now.  To a being like this what a gift it must be to have firsts, or a conception of an end.  To forget if only in delusion the infinite self.  What a gift the finite, the present would be to an entity with this conception of self.  Hold in mind this concept, of a self that has ultimately been every name. Now lets twist things around a bit.  From this side we have taken natural time and using computers increased the effective time people live.
I could go into clock cycles, and try to get into ideas of changing the fundamental flow of time. How the pure access to information, and the speed of dissemination changes who we are and how we interact with our world.  Many have talked about how disconnected we have become from each other on a personal level. Even as our world has become infinitely smaller, as people all over the globe instantly communicate real time. How quickly our understanding changes and grows, how difficult it becomes to stay current.  How easy it becomes to be lost in a technological time warp.  If we are to believe that Moore's law will hold true for even the next 20 years the changes from this moment to that moment will be astounding.
    Now for a bit of the inane at least from my perspective.  I have been playing with, and learning about the crypto-currencies. Some Ideas on Bitcoin, what makes this valuable it has no backing.  There is the idea that it currently has the largest distributed network ever created.  This is amazing, and sad. Amazing that it's been created at all. Sad that it's being used to make essentially video game money.  Virtual gold coins to be traded in a virtual world. Who's use creates the value, Just as the value of the U.S. Dollar is in the decline due to losing it's status as the worlds trade currency.  You can argue that last statement, though it would be one of extent.  While yes technically the Dollar remains the worlds reserve currency it is steadily losing it's use as a trade currency.  Bitcoin's use and acceptance as a cross boarder currency in an increasingly globalized world will only hasten the decline.  This doesn't make Bitcoin the answer, as it seems even farther removed from the resources then the traditional fiat currencies we are already using.  If the Dollar is rotten, anything that has it's value tied directly to the dollar has to be rotten as well.


Jack
aka
PanseyBard

Friday, December 27, 2013

The Tower of Babel Undone

         The Tower of Babel, the idea that all people at one time had a common language, but through the arrogance of trying to reach GOD our punishment was confuse our tongues.  For those that would like a bit more in depth look at this story please check here, http://www.omniglot.com/babel/. Honestly I'm not as interested in the exact details, as I am in now.  This is a story that has roots in so many cultures there is more then likely some truth to it, even if it is not in the way we think.  As our use of computers has grown, and the capabilities of those computers has grown, we have intentional or effectively undone this event.
We now have at our finger tips instant translation. My phone can listen for me and speak translations at almost real time.  My browser translates full page texts with improvements ongoing to ensure the most correct translations possible.  There is even bubble translation which can be used both directions. Giving the ability to not only translate portions of text, but also write in your native text and have translated into any number of languages.  We have effectively undone this classical story.  What are the ramifications of this punishment by GOD being undone by man?   Why have the end of the world folks seemingly left this topic alone?  This story is from a GOD that doesn't seem to take kindly to interference, or rules breaking. This is a GOD that endorsed the plagues of Egypt, the destruction of Sodom, and Gomorrah.  How a GOD with this track record reacts to having it's ruling circumvented can only be imagined.
       I am not a religious person, I do not profess, or follow any given religion.  I love studying religions, it's a passion. I guess I'm looking for something greater interacting, and taking an interest in humanity.  So this story in particular is of interest due to it being currently unfolding, a link back to biblical times. I thread of story active in my current reality that has it's roots in a time of wonder when gods walked the earth, and man with all it's flaws wasn't considered the power.  As always these are just random thoughts rattling around my mind, take them as such.

Jack
aka
PanseyBard 

Monday, November 25, 2013

Making my childhood a crime, and me a criminal!

        I know that seems a bit overly dramatic, and it is, kinda.  The circumstances surrounding my childhood are the perfect slip through the cracks, that just leaves people wondering.  Whats funny from my perspective is I had no clue till everyone told me.  Did I live the Norman Rockwell painting, not exactly. My father took his own life when I was 3, I was a latchkey kid by 5.  Before I turned 9 and moved across the country to start a new life I had no clue people thought my home was messed up.  I was in gifted classes, my Mom though not around all the time was there when really needed to be the support, or the encouragement, or the hammer.  It wasn't till I was in a place where 2 parents were expected did I even give my own situation a thought.  It still didn't make a dent, as I was by 11 or 12 watching other peoples children, so how bad could my upbringing have been if other people felt I was worthy of taking care of their kids.  Of course this only lasted a few years till I got tired of watching the kids while my friends did other things. By about 15 I was moved on, by 17 I more or less had my own condo.  Mom paid the bills, but she wasn't there very often, sometimes I would avoid her for as long as 2 months.  I was never alone, my house became the place for the lost boys. We became wanna be skater punks, I say wanna be as we were never mean.  Never really wanted to do harm, we just were discovering who we were, and our boundaries were of our own making.
        What most people couldn't believe was where I stopped. Before I turned 18 I had not had intercourse, had only tried pot and didn't care for it, and had taken alcohol to where it already told me it was a nasty drug to be used carefully.  How am I supposed to feel when my childhood is looked upon with a mixture of sadness, sorrow, and sometimes incredulity. When I wouldn't change a thing, my whole life everyone has told me that the physical is fleeting.  I believed them, I went looking for intangible, it finds you.  So maybe if you look at someone as having something to say, maybe you might want to ease up on what they needed to go through to learn it.

Jack

Friday, November 15, 2013

Letter From Infinity

             This is a factual letter from the infinite No names will be changed as everyone is equally guilty. Any resemblance to the actual infinite is purely coincidental.


          Dear Finite


                      It has come to my attention that you have been impersonating me. I understand the envy involved, you turn the corner to head back down that same path. While I chart oh wait, this isn't about me.  About the trick....you know the twist and hold.  Oh come on!!!! are your really gonna make me tell everyone!!!
I will you know. I'll just bust the finite wide open....I apologize for that outburst, it's just sometimes your so hurtful.  All I'm asking is to have a relationship with our children.  I know we agreed to terms of visitation, you have yet to give me even a single weekend with them.  I'm all caught up on my support payments.  I still remember when we were first learning to play, It was so scary being enclosed at first. You'd surround, I'd scream and scream. you'd open just a enough to let a little of the nothing in so I would have comfort. Oh how I long for those simple pleasures. My touch causing you to melt. Oh how I loved watching you take the 1 and 0 turn em into a mock up of me.  I tell you this, use your symbols of me, think you know me.  I will be waiting for you like a long lost friend, or the big bad wolf. Your choice.  And when you long for the taste of flesh off ya go, all refreshed and ready for the machine.  Damn I hate you, or love you I don't even know any more.

Sincerely 81

P.S.  please leave the stuff in the usual place.

P.P.S your leaking really bad


Jack
aka
PanseyBard