Best Adsense month so far

Last month I made $6.51 from Adsense revenue, the best month so far since I started this experiment. Although I didn’t hit the magic “1 roll of Portra 400” mark, it came pretty close.

november-2016-adsense

I credit a lot of the new Adsense revenue to switching to a WordPress theme and using the Adsense plugin by Google. Everything appears to be better optimized, but I’m sure I could do more.

Python Script Experiments

I also started experimenting with some modified Python scripts to automate some of my Twitter tasks. My automation bot R2D2 spends time each morning scanning popular #ai and #machinelearning posts and then retweets them.

Since I’ve been doing that, I’ve noticed a deluge of Twitter users putting me on a list. I suspect that’s some sort of Bot scanning retweets and then auto populating me on a list. I will monitor this as a I go along.

I’ve also noticed a bump in new followers but also a strange unfollowing within 24 hours. I think there is some sort of automated script running that autofollows me in the hope that I’ll follow them back and then it unfollows me. I’ve noticed the same handful of Tweeple follow me and then follow me again. So they must be unfollowing me between the two follows.

 

A Simple Blog Post Tweeter

I continue on my journey to rebuild this blog’s traffic. One idea I had was to build a simple Python based blog post tweeter. I would select a blog post at random and then tweet it to my @neuralmarket Twitter account. I chose Python because of the Twython package. It made for a simple connection to my Twitter account and was easy to parse a text file.

The idea was this. I create a text file of all the blog posts I want to retweet – appended with a bit.ly link – and write a catchy tweet. I would then run the Python script to select at random a pre-written tweet from the text file. When I’m ready, I can cron job this script and run it once or twice a day. Over time I can add or delete pre-written tweets or try to optimize them for SEO.

I suggest that all my readers try this, it’s not hard and is simple to follow.

The Twitter Token

First you have to get a Twitter token. This allows you the Python script to post on your behalf and there are four bits of information you need. First visit dev.twitter.com and navigate to the application owner access token page. There you can learn on how to make a single application and generate the follow api values:

  1. Consumer Key
  2. Consumer Secret
  3. Access Token
  4. Access Token Secret

You’ll need these four items for the Python script below.

The text file

Next, create a simple text file (TXT extension) and put a single tweet per line. Make sure to add your blog post link. I use bit.ly to shorten my long URLs.

Here’s an example of my text file:

Make sure to save this file in the same directory as your Python script. I keep all my scripts and files in a Dropbox folder so I can access it anywhere.

The Code

Now here’s the code. I’m going to XXX out my consumer and access keys, you’ll have to add your own from the first step above.

It’s as simple as that. Just remember you need to install the Twython package and I wrote this script in Python v2.7. Any questions, just drop me a comment.

Source: Blot NMT Feed

Plugging in Plot.ly, Python, and RapidMiner

I’ve struggled for a while trying to build an embedded visualization for my auto-generated blog posts. I tried D3js (javascript), Bokeh (python), and Plot.ly (various languages) and got frustrated quickly for something that will allow me to easily create and auto embed a chart.

In general, D3js has no barriers for embedding but it’s a pain in the butt to code javascript for a non-coder like me. Bokeh uses python and is kinda of nice since I know python but it’s very hard to auto embed a visualization on the fly. Plus the generated visualization is 1,000′s of lines of autogenerated code and clipping and pasting the code into a markdown post is a no-no for me.

Next I investigated Plotly. While not 100% perfect, I liked it from the get go. It’s syntax is very easy to learn and you can code it using javascript, python, pandas, and R. Since I tend to avoid R, I tried coding in their javascript and python/pandas API. The same frustrations I had in coding D3js came back for their javascript API, so I focused completely on their python/pandas API.

That was a success. When I wrote out the python/pandas code and them embedded it my RapidMiner process (see below), I successfully generated a static PNG image from my RapidMiner process and auto embedded it into my markdown post.

The only snag I ran into is that I needed to get an API token from Plot.ly to autogetnerate the static image. You can see in the code below that I X’d” it out but it was pretty easy to get it once you create an account with Plot.ly.

If you check out the python code I put into the RapidMiner Execute Python operator, you’ll notice that I use macros to alter the name of the autogenerated files. This is crucial if I want to set it and forget it” autoposting in a production sense (like using the RapidMiner Server), but that’s a post for another day.

Here’s the python code in RapidMiner: