Sunset on OAuth and TAGS 5.1
July 7, 2015 at 4:02 pm #504
I’m using an old version of TAGS (5.1) because of some requirements my project has with regard to control over specific code in the scripts editor on TAGS.gs.
Yesterday, Twitter sunsetted the OAuth support in favor of OAuth1 and OAuth2.
I am trying to figure out how to alter the scripts on my older Spreadsheet properly to switch over to one of these, but I am unsure of even whether I should be using OAuth1 or OAuth2.
Any guidance someone could provide would be greatly appreciated!
Brian GeyerJuly 7, 2015 at 10:37 pm #505mhawkseyKeymaster
Hi – it’s not straight forward. It might be easier to explain how you can lift code from TAGS 5.1 into a TAGS 6.0 templateJuly 8, 2015 at 1:19 am #506
Thanks for the response.
The relevant portion of the code is altered in a few different places. I added a params.geocode with a radius and altered a middle section of the getTweets function with an additional boolean to more specifically filter out tweets not desired and with alterations to the geo coordinates portion of that function (so that it spits out latitude and longitude separately). I also deleted the user input portion of the deleteDuplicates (near the bottom of that function’s code related to the variable resp).
I wouldn’t mind switching to v6, but it is really important to me that these three alterations survive in some form because I’m using the sheet as a way to publish an up-to-the-minute .csv file for a mapping project (http://kenya-tweet.matrix.msu.edu – fair warning: awful color scheme ahead).July 9, 2015 at 7:51 pm #507mhawkseyKeymaster
Hi – here’s one way around this:
1. Open and make a copy of this script file, making the changes required.
2. When done Save and set to Share for anyone with link, view only.
3. Still in the script select File > Manage versions and create a script version.
4. Finally open File > Project properties and copy the Project key
Next we need to get a copy of the template using your code. To do this:
1. Make a copy of the new TAGS template.
2. Open Tools > Script editor and then Resources > Libraries
3. Remove the TAGS library and in the ‘Find a library’ field enter the Project Key from earlier., selecting a version and clicking save (you probably also want to switch on ‘development mode’, this means if you make changes in the copy of the script you made earlier they will be used in your copy of the template).
After you’ve done this you should be able to setup TAGS v6.0 as normal. If you need further archives remember to copy your modified template.
These steps are untested so shout if not workingJuly 9, 2015 at 11:28 pm #508
You sir deserve all the beers! Thanks!
For anyone following along or stumbling onto this, after following the instructions above, you must make sure to set the Identifier for your new library to ‘TAGS’, which you upload in the second step 3. Without doing this (or changing most instances of ‘TAGS’ in the script attached to the spreadsheet to whatever the new identifier is), your spreadsheet will not know where to look for the appropriate functions to run.
I should say, I now have an up-and-running TAGS v.6.0 spreadsheet, but I’ve also implemented these changes on an older v.5.1 because of a change Google made to their spreadsheets before you created v6.0, which was preventing my project from importing the published spreadsheet (for more info on that particular issue, see http://stackoverflow.com/questions/20364662/access-control-allow-origin-error-on-google-drive-web-site). This doesn’t bode well for the future of my project…
Again, thanks for all your help, Mr. Hawksey!
- This reply was modified 7 years, 7 months ago by bsgeyer. Reason: clarity
- You must be logged in to reply to this topic.