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

New Function: Shorten #64

Closed
neocotic opened this issue Feb 8, 2012 · 2 comments
Closed

New Function: Shorten #64

neocotic opened this issue Feb 8, 2012 · 2 comments
Assignees
Milestone

Comments

@neocotic
Copy link
Member

@neocotic neocotic commented Feb 8, 2012

Calls the URL shortener service with the rendered contents (hopefully a URL - trust the user here but perform simple validation - i.e. is blank, maybe also check that it matches /^https?:\/\/\S+\.\S+/).

During the initial render, replace all URLs with a unique placeholder (using utils.keyGen w/o a separator) while ensuring duplicate URLs are replaced with the same placeholders (minimizing calls to the web service) and then render the result again for each replacement, this time replacing the placeholders with the response from the web service (or showing any errors if they were encountered).

This makes {short} obsolete and therefore should be deprecated, replacing its functionality with {#shorten}{url}{/shorten}, which should also be used to replace the contents of the Short template.

@neocotic
Copy link
Member Author

@neocotic neocotic commented Feb 10, 2012

I need to fix OAuth. I'm not sure why it's no longer working but it needs fixed. I'll compare the request sent now to that sent prior to these changes and hopefully that'll help identify the source of this issue.

I'm happy with the way it's working otherwise.

Loading

neocotic added a commit that referenced this issue Feb 13, 2012
neocotic added a commit that referenced this issue Feb 13, 2012
@neocotic
Copy link
Member Author

@neocotic neocotic commented Feb 13, 2012

The recent changes for #20 have enabled this process to flow much smoother and without incident. I'm very happy with the results.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant