{"id":11806,"date":"2020-02-13T20:22:23","date_gmt":"2020-02-13T20:22:23","guid":{"rendered":"https:\/\/johnjohnston.info\/blog\/?p=11806"},"modified":"2020-02-14T16:57:34","modified_gmt":"2020-02-14T16:57:34","slug":"a-bit-of-twitter-research","status":"publish","type":"post","link":"https:\/\/johnjohnston.info\/blog\/a-bit-of-twitter-research\/","title":{"rendered":"A bit of twitter research"},"content":{"rendered":"<p>I&#8217;ve talked to a fair number of teachers who find it easier to use twitter than to blog to share their classroom learning. I&#8217;ve been thinking a little of how to make that easier but got side tracked wondering how schools, teachers and classes use twitter.<\/p>\n<p>If you use twitter on the web it tells you the application used to post the tweet. At the bottom of a tweet there is the date and the app that posted the tweet.<\/p>\n<p>I&#8217;ve got a list that is made up of North Lanarkshire schools I started when I was supporting ICT in the authority.<\/p>\n<p>I could go down the list and count the methods but I though there might be a better way. I recalled having a played with the twitter api a wee bit so searched for and found: <a href=\"https:\/\/developer.twitter.com\/en\/docs\/accounts-and-users\/create-manage-lists\/api-reference\/get-lists-statuses\">GET lists\/statuses \u2014 Twitter Developers<\/a>. I was hoping ther was some sort of console to use, but could not find one, a wee bit more searching found how to authenticate to the api using a token and how to generate that token. <a href=\"https:\/\/developer.twitter.com\/en\/docs\/basics\/authentication\/oauth-2-0\/bearer-tokens\">Using bearer tokens<\/a><\/p>\n<p>It then didn&#8217;t take too long to work out how to pull in a pile of status updates from the list using the terminal:<\/p>\n<p><code>curl --location --request GET 'https:\/\/api.twitter.com\/1.1\/lists\/statuses.json?list_id=229235515&amp;count=200&amp;max_id=1225829860699930600'  --header 'Authorization: Bearer BearerTokenGoesHere'<\/code><\/p>\n<p>This gave me a pile of tweets in json format. I had a vague recollection that google sheets could parse json so gave that a go. I had to upload the json somewhere I could import it into a sheet. This felt somewhat clunky. I did see some indications that I could use a script to grab the json in sheets, but though it might be simpler to do it all on my mac. More searching, but I fairly quickly came up with this:<\/p>\n<p><code>curl --location --request GET 'https:\/\/api.twitter.com\/1.1\/lists\/statuses.json?list_id=229235515&amp;count=200&amp;'  --header 'Authorization: Bearer BearerTokenGoesHere'  | jq '.[].source' | sed -e 's\/&lt;[^&gt;]*&gt;\/\/g' | sort -bnr   | uniq -c | sort -bnr<\/code><\/p>\n<p>This does the following:<\/p>\n<ol>\n<li>download the status in json format<\/li>\n<li>passes it to the <a title=\"jq\" href=\"https:\/\/stedolan.github.io\/jq\/\">jq<\/a> application (which I had installed in the past) which pulls out a list of the sources.<\/li>\n<li>It is then passed to sed which strips the html tags leaving the text. (I just search for this, I have no idea how works)<\/li>\n<li>next the list is sorted<\/li>\n<li>then uniq pulls out the uniq entries and counts then<\/li>\n<li>Finally sorts the counts and gave:<\/li>\n<\/ol>\n<pre>119 \"Twitter for iPhone\"\n  28 \"Twitter for Android\"\n  22 \"Twitter Web App\"\n   8 \"Twitter for iPad\"\n   1 \"Twitter Web Client\"<\/pre>\n<p>This surprised me. I use my school iPad to post to twitter and sort of expected iPads to be highest or at least higher.<\/p>\n<p>It maybe that the results are skewed by the Monday, Tuesday holiday and 2 inservice days, so I&#8217;ll run this a few times next week and see. You can also use a max_id parameter so I could gather more than 200 (less retweeted content) tweets.<\/p>\n<p>This does give me the idea that it might be worth explaining how to make posting to Glow Blogs simpler using a phone.<\/p>\n<p>Update, Friday, bacn to school and NLC looks like:<\/p>\n<pre> 74 \"Twitter for iPhone\"\n  51 \"Twitter for iPad\"\n  18 \"Twitter for Android\"\n  10 \"Twitter Web App\"\n   1 \"dlvr.it\"\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve talked to a fair number of teachers who find it easier to use twitter than to blog to share their classroom learning. I&#8217;ve been thinking a little of how to make that easier but got side tracked wondering how schools, teachers and classes use twitter. If you use twitter on the web it tells [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":11807,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"mf2_syndication":["https:\/\/twitter.com\/johnjohnston\/status\/1228053153679106053"],"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"webmentions_disabled_pings":false,"webmentions_disabled":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[443,80,26],"post_format":[],"class_list":{"0":"post-11806","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-wwwd","8":"tag-bash","9":"tag-fun","10":"tag-twitter","11":"kind-article","13":"h-entry","14":"hentry"},"better_featured_image":{"id":11807,"alt_text":"graph of number twitter clients used by schools","caption":"","description":"","media_type":"image","media_details":{"width":840,"height":460,"file":"2020\/02\/school-twitter-clients.png","sizes":{"medium":{"file":"school-twitter-clients-620x340.png","width":620,"height":340,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/02\/school-twitter-clients-620x340.png"},"thumbnail":{"file":"school-twitter-clients-150x150.png","width":150,"height":150,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/02\/school-twitter-clients-150x150.png"},"medium_large":{"file":"school-twitter-clients-768x421.png","width":768,"height":421,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/02\/school-twitter-clients-768x421.png"},"post-thumbnail":{"file":"school-twitter-clients-668x366.png","width":668,"height":366,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/02\/school-twitter-clients-668x366.png"},"sempress-image-post":{"file":"school-twitter-clients-668x366.png","width":668,"height":366,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/02\/school-twitter-clients-668x366.png"},"rpwe-thumbnail":{"file":"school-twitter-clients-45x45.png","width":45,"height":45,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/02\/school-twitter-clients-45x45.png"},"jetpack-portfolio-admin-thumb":{"file":"school-twitter-clients-50x50.png","width":50,"height":50,"mime-type":"image\/png","source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/02\/school-twitter-clients-50x50.png"}},"image_meta":{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0","keywords":[]}},"post":11806,"source_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/02\/school-twitter-clients.png"},"jetpack_featured_media_url":"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/02\/school-twitter-clients.png","jetpack_shortlink":"https:\/\/wp.me\/p57zFQ-34q","jetpack_likes_enabled":false,"jetpack_sharing_enabled":true,"kind":false,"_links":{"self":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/11806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/comments?post=11806"}],"version-history":[{"count":3,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/11806\/revisions"}],"predecessor-version":[{"id":11813,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/11806\/revisions\/11813"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/media\/11807"}],"wp:attachment":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/media?parent=11806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/categories?post=11806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/tags?post=11806"},{"taxonomy":"post_format","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/post_format?post=11806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}