Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-enable sharing statistics #11

Open
mmmaaatttttt opened this issue Jun 10, 2020 · 4 comments
Open

re-enable sharing statistics #11

mmmaaatttttt opened this issue Jun 10, 2020 · 4 comments
Assignees
Labels
refactor Refactor of existing functionality
Milestone

Comments

@mmmaaatttttt
Copy link
Collaborator

There's a bunch of commented-out code here:

https://github.com/rithmschool/numbers_api/blob/master/app.js#L21-L39

and here:

https://github.com/rithmschool/numbers_api/blob/master/app.js#L48-L91

would be nice to add this back. Right now, there are a couple of problems:

  1. The API version has changed, so the commented out code is busted.
  2. Would be better to not have code in a setInterval -- instead, let's just get the num shares from within the route handler as needed.
@mmmaaatttttt mmmaaatttttt added the refactor Refactor of existing functionality label Jun 10, 2020
@mmmaaatttttt mmmaaatttttt added this to the Version 1.1 milestone Jun 10, 2020
@mmmaaatttttt
Copy link
Collaborator Author

Relatedly, this block seems to be related to the same functionality, this ticket should handle the todo here:

// TODO: The leading dot check is a hack to prevent addThis hash tags
$(window).on('hashchange', updateAllFromHash);
if (!window.location.hash || window.location.hash[1] === '.') {
update_history('42');
}
setTimeout(updateAllFromHash, 0);

@Nalipp
Copy link
Contributor

Nalipp commented Apr 29, 2021

Here is the new api.
https://www.addthis.com/academy/developers/
Determine if it is feasible to replicate the original functionality of the share statistics with the new api.

@jacobson-ben
Copy link
Collaborator

jacobson-ben commented May 5, 2021

We should be able to replicate the functionality. However, we need to add a script to the deployed website so that the API can begin tracking shares / visits. The URL and script for this is below:

URL: https://www.addthis.com/dashboard#get-the-code/pub/ra-5e4e232d004d763e

Script: <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5e4e232d004d763e"></script>

Until then, it probably does not make too much sense to write the functionality, as it will be hard to test functionality without website tracking data. Right now, we only get an empty array back from the API.

@mmmaaatttttt
Copy link
Collaborator Author

@jacobson-ben in that case it may make sense to open a separate PR just to include this script tag, and then we go from there. I don't exactly remember the work flow for creating a new deploy but either @Nalipp or I can figure it out. eventually this will hopefully be handled by #12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactor of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants