Jump to content
raik

Request/help: Lorem Ipsum Generator

Recommended Posts

So, it took me a little longer than anticipated because I ran into an issue. I swapped to getting the result as json instead of parsing HTML and so, when you request multiple items (i.e. 2 paragraphs) the line breaks between them was messing up the json.

 

Download

 

Lipsum keyword allows you to select what it is that you want, then just enter the amount, or, there are defaults

 

Usage:

lipsum - Grabs the selected type with a default amount

lipsum 3 - Grabs 3 of the selected item

Share this post


Link to post

So, it took me a little longer than anticipated because I ran into an issue. I swapped to getting the result as json instead of parsing HTML and so, when you request multiple items (i.e. 2 paragraphs) the line breaks between them was messing up the json.

 

Download

 

Lipsum keyword allows you to select what it is that you want, then just enter the amount, or, there are defaults

 

Usage:

lipsum - Grabs the selected type with a default amount

lipsum 3 - Grabs 3 of the selected item

Huge thanks!

Share this post


Link to post

Awesome:

 

Sed eget arcu turpis, vitae eleifend massa. Nulla pretium, justo id euismod convallis, ligula tortor mattis augue, eu facilisis sapien dui nec ante. Maecenas ipsum elit, mattis posuere blandit eu, fermentum feugiat enim. Fusce placerat felis ac enim interdum commodo. Suspendisse ultrices congue mauris eu tempor. Nulla facilisi. Sed ut sapien arcu, ut tempor leo.

Share this post


Link to post

Awesome:

 

Sed eget arcu turpis, vitae eleifend massa. Nulla pretium, justo id euismod convallis, ligula tortor mattis augue, eu facilisis sapien dui nec ante. Maecenas ipsum elit, mattis posuere blandit eu, fermentum feugiat enim. Fusce placerat felis ac enim interdum commodo. Suspendisse ultrices congue mauris eu tempor. Nulla facilisi. Sed ut sapien arcu, ut tempor leo.

 

I don't understand what you're saying. Can you speak English? (obviously kidding :))

Share this post


Link to post

Any chance of getting this to offer to generate x characters of lipsum text? :-)

 

Maybe? I just set it up to grab data directly from lipsum.com. They don't currently offer a X characters option. So this would either have to be generated or queried from another source.

Share this post


Link to post

Anyone else noticed that for some reason this workflow has stopped working recently? Or is it just me?

Share this post


Link to post

The lipsum.com site is a bit slow at the moment.
 
I wrote an offline fake data workflow that includes lorem ipsum (the paragraphs option). That one runs completely locally (no webservices), so it's 100% reliable and a lot faster. Not as configurable wrt lipsum, however, as it's designed to cover a lot more types of fake/placeholder data.

Share this post


Link to post

Managed to fix it! :)

 

Must have been to do with lipsum.com forcing SSL. Just requires changing "curl http://lipsum.com" to "curl https://lipsum.com" in the 4 PHP scripts.

 

@deanishe Your workflow looks great, but overkill for my needs. Plus your generated paragraphs could be a bit longer :)

Share this post


Link to post

@jcwacky What does "overkill" mean? The workflow isn't huge, you don’t have to use the other features, and it's trivial to add a Script Filter that goes directly to the Lipsum feature.

 

If the paragraphs are too short, I can add an option to specify their length (the underlying library defaults to 3 sentences, but that's configurable and I can easily expose that option to workflow users).

 

Most importantly, the workflow is maintained and entirely self-contained, so it isn't going to stop working if an API changes, a server is inaccessible or if you're simply offline.

 

As theoretically better as David's workflow may be, it’s essentially abandoned. The download link is dead, and David — quite understandably — hasn’t had much time for the Alfred community since he became a father (his last post was almost a year ago).

 

If one of you would like to fork, fix and maintain the workflow, that'd be great. If not, then it's only a matter of time till it stops working again.

 

Also, a good tip for anyone using curl in a workflow: Always add -L to curl calls, so it follows redirects. If David had done that, his workflow would still be working. (But I wouldn't recommend that as a fix.)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×