Skip to content

Instantly share code, notes, and snippets.

@eri451
Created April 30, 2012 14:28
Show Gist options
  • Select an option

  • Save eri451/2558796 to your computer and use it in GitHub Desktop.

Select an option

Save eri451/2558796 to your computer and use it in GitHub Desktop.

Revisions

  1. eri451 created this gist Apr 30, 2012.
    33 changes: 33 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    let title = subscriber.getTitle(feedhref);
    if (!options.feedtitle){
    if (title === undefined || title === ""){
    commandline.input("Title: ", createFeed, { argCount: "+"});
    }
    else{
    createFeed(title)
    }
    else{
    commandline.input("Change title \'" + title + "\' ? [y,N]",
    getTitleFromUser,
    { argCount: "1" });
    }

    function createFeed(args){
    if (typeof(args) === "string") title = args;
    lvmsvc.createLivemark(
    subscriber.getFeedFolderId(),
    title,
    iosvc.newURI(loc, null ,null),
    iosvc.newURI(feedhref, null, null),
    -1
    );
    }

    function getTitleFromUser(args){
    if (args[0].length === 0
    || "" + args[0] === "N"
    || "" + args[0] === "n"
    || "" + args[0] === "y"){
    if ("" + args[0] !== "y") createFeed();
    else
    commandline.input("Title: ", createFeed, { argCount: "+" });