Sublime Forum

Plugin Request: Fetch

#1

Hey guys! So I have a plugin request that I think could be helpful to a large number of people. There should be an easy non-terminal way for people to pull in pieces of code. For example, let’s say that I’m using Eric Meyer’s reset; I could save it to a snippet, but then, if he updates it at any point, I’m now using an out-dated stylesheet.

Can one of you build a curl plugin? As I imagine it, there could be an options page for attaching urls to keys.

{
‘reset’ : ‘http://meyerweb.com/eric/tools/css/reset/reset.css’,
‘prefix-free’ : ‘https://raw.github.com/LeaVerou/prefixfree/master/prefixfree.min.js
/// etc
}

These keys will then be available to me as commands (maybe under a “fetch” namespace or something). So, I create a new blank reset.css file, run the “fetch reset” command, and, behind the scenes, the plugin fetches the data and pastes the result into the current file.

(It would be even cooler if there was a way to fetch zip files. Maybe I want the latest version of WordPress. I can run “fetch WordPress”, and it will use the url to the latest release of the framework, download the zip file, and extract it to the project directory.)

Granted, I know it’s easy to do something like: curl meyerweb.com/eric/tools/css/reset/reset.css > reset.css in the terminal, but a plugin like this would still prove to be helpful for a few reasons:

  • You don’t have to memorize these urls
  • Designers hate the command line
  • It’s faster

So let me know what you think. If incentive is required, I’m the editor of Nettuts+. If one of you would build it, and allow us to brand/name it as Nettuts+ Fetch (or something similar), we could pay you $400. Either way works!

0 Likes

Pull jQuery plugin from git inside sublime
#2

Bump!

Seriously, this would be really cool and useful. :smile:

0 Likes

#3

woof woof

0 Likes

#4

Adding a bounty to plugin requests? I like the sound of that.

0 Likes

#5

Just wrote it and it works great :smiley:

github.com/weslly/Nettuts-Fetch

EDIT: Updated the repository url :smile:

0 Likes

#6

Sweet. Wow that was fast!! Works perfectly. :smiley:

0 Likes

#7

Damn weslly, looks like you just made $400.

0 Likes

#8

weslly, I gotta say that is super impressive. I’m trying this plugin, ASAP.

0 Likes

#9

Very good package for sublime but not perfect (for me).
It would be perfect if it included a third option like file download. it will use the same options for file but instead of adding the code inline it will download to a folder defined in the settings of the package (something like /public_hml/js or /web/js) and add the code for inclusion where the cursor is. (it can detect if the file is a .css or a .js to use the correct html tags or )

This suggestion is that by using this package with some large files you import a lot of code in your files while downloading code to a defined folder remains the organization. In some cases is good your aproach in other cases this will be a better option. (Sorry for my english, im spanish)

0 Likes

#10

I agree. It would be great to also have an “Open as file” mode, where single files can be fetched (read-only) and then refreshed either automatically or manually.

Use case: I have a javascript file at a url (e.g. localhost/dev.js) that isn’t minified, but is compiled into a single file. In cross-browser testing, errors come up with a line number but no other information. Once I see that line, I can quickly find the correct file to change.

0 Likes

#11

Hi
on fetching a zip package it would be good if it was to un-pack the zip and then show the content for us to select what we want and what we do not want?
I.E. :
“osCommerce_Online_Merchant_v2”: “https://github.com/osCommerce/oscommerce2/zipball/master

I use a lot of times so this plug-in is so handy.

But this zip has some files and folder I do not need so at this time I have to go and delete what I do not need, Well out of the zip I only need the content of just one of the folder “catalog” and then need the content of that moved the root of the folder it is downloaded to.

So what I am asking for is to be able to select from the unpacked zip so to only save what we want.

Simon

0 Likes