{"database": "pelican", "table": "content", "is_view": false, "human_description_en": "where author = \"ryan\" and published_date = \"2016-11-25\"", "rows": [["ryan", "technology", "In one of my [previous\nposts](https://www.ryancheley.com/blog/2016/11/22/twitter-word-cloud) I walked\nthrough how I generated a wordcloud based on my most recent 20 tweets. I\nthough it would be _neat_ to do this for my [Dropbox](https://www.dropbox.com)\nfile names as well. just to see if I could.\n\nWhen I first tried to do it (as previously stated, the Twitter Word Cloud post\nwas the first python script I wrote) I ran into some difficulties. I didn't\nreally understand what I was doing (although I still don't **really**\nunderstand, I at least have a vague idea of what the heck I'm doing now).\n\nThe script isn't much different than the [Twitter](https://www.twitter.com)\nword cloud. The only real differences are:\n\n  1. the way in which the `words` variable is being populated\n  2. the mask that I'm using to display the cloud\n\nIn order to go get the information from the file system I use the `glob`\nlibrary:\n\n    \n    \n    import glob\n    \n\nThe next lines have not changed\n\n    \n    \n    import matplotlib.pyplot as plt\n    from wordcloud import WordCloud, STOPWORDS\n    from scipy.misc import imread\n    \n\nInstead of writing to a 'tweets' file I'm looping through the files, splitting\nthem at the `/` character and getting the last item (i.e. the file name) and\nappending it to the list `f`:\n\n    \n    \n    f = []\n    for filename in glob.glob('/Users/Ryan/Dropbox/Ryan/**/*', recursive=True):\n        f.append(filename.split('/')[-1])\n    \n\nThe rest of the script generates the image and saves it to my Dropbox Account.\nAgain, instead of using a [Twitter](https://www.twitter.com) logo, I'm using a\n**Cloud** image I found [here](http://www.shapecollage.com/shapes/mask-\ncloud.png)\n\n    \n    \n    words = ' '\n    for line in f:\n        words= words + line\n    \n    stopwords = {'https'}\n    \n    logomask = imread('mask-cloud.png')\n    \n    wordcloud = WordCloud(\n        font_path='/Users/Ryan/Library/Fonts/Inconsolata.otf',\n        stopwords=STOPWORDS.union(stopwords),\n        background_color='white',\n        mask = logomask,\n        max_words=1000,\n        width=1800,\n        height=1400\n    ).generate(words)\n    \n    plt.imshow(wordcloud.recolor(color_func=None, random_state=3))\n    plt.axis('off')\n    plt.savefig('/Users/Ryan/Dropbox/Ryan/Post Images/dropbox_wordcloud.png', dpi=300)\n    plt.show()\n    \n\nAnd we get this:\n\n![Word Cloud](/images/uploads/2017/12/dropbox_wordcloud-300x200.png)\n\n", "2016-11-25", "dropbox-files-word-cloud", "In one of my [previous\nposts](https://www.ryancheley.com/blog/2016/11/22/twitter-word-cloud) I walked\nthrough how I generated a wordcloud based on my most recent 20 tweets. I\nthough it would be _neat_ to do this for my [Dropbox](https://www.dropbox.com)\nfile names as well. just to see if I could.\n\nWhen I first tried to do it \u2026\n\n", "Dropbox Files Word Cloud", "https://www.ryancheley.com/2016/11/25/dropbox-files-word-cloud/"]], "truncated": false, "filtered_table_rows_count": 1, "expanded_columns": [], "expandable_columns": [], "columns": ["author", "category", "content", "published_date", "slug", "summary", "title", "url"], "primary_keys": ["slug"], "units": {}, "query": {"sql": "select author, category, content, published_date, slug, summary, title, url from content where \"author\" = :p0 and \"published_date\" = :p1 order by slug limit 101", "params": {"p0": "ryan", "p1": "2016-11-25"}}, "facet_results": {}, "suggested_facets": [{"name": "published_date", "type": "date", "toggle_url": "http://search.ryancheley.com/pelican/content.json?author=ryan&published_date=2016-11-25&_facet_date=published_date"}], "next": null, "next_url": null, "private": false, "allow_execute_sql": true, "query_ms": 23.724800907075405}