From e943623717ef9118884d3308935655794b341b94 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Wed, 22 Mar 2017 19:52:01 -0400 Subject: [PATCH] light faq cleanup, more needed --- content/faq/api-help.md | 35 ++++++++-------------- content/faq/benefit-consumers.md | 1 + content/faq/custom-ui.md | 14 --------- content/faq/development-status.md | 2 +- content/faq/is-lbry-open-source.md | 6 ++-- content/faq/lbry-name.md | 1 + content/faq/lbry-revenue.md | 2 +- content/faq/make-money.md | 2 +- content/faq/naming.md | 1 + content/faq/what-is-lbry.md | 9 +++--- content/faq/why-care-about-lbry.md | 13 -------- controller/Controller.class.php | 1 + controller/action/ContentActions.class.php | 6 ++-- model/Post.class.php | 19 +++++++++++- 14 files changed, 48 insertions(+), 64 deletions(-) delete mode 100644 content/faq/custom-ui.md delete mode 100644 content/faq/why-care-about-lbry.md diff --git a/content/faq/api-help.md b/content/faq/api-help.md index a11f5160..88392dad 100644 --- a/content/faq/api-help.md +++ b/content/faq/api-help.md @@ -3,16 +3,26 @@ title: How do I see the list of API functions I can call, and how do I call them category: developer --- +## The LBRY API + +The best way to learn how to use the LBRY API is to go through our [quickstart](https://lbry.io/quickstart). + +A full list of API calls provided by LBRY is available in [the API documentation](https://lbry.io/api). + +If you're new to LBRY, this is probably the API you want. + +## The LBRY Blockchain API (lbrycrd) + Ensure that `lbrycrd` is running with the `-server` flag, which enables the JSON-RPC API. Then use one of the following methods to make API calls. Many (though not all) of the calls are the same as those for bitcoin core, which are documented [here](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list). To see the full list of API calls, use the `help` API call. -## lbrycrd-cli +### lbrycrd-cli lbrycrd-cli help -## curl +### curl curl --user USER:PASSWORD --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "help", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/ @@ -22,24 +32,3 @@ documented [here](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_l - If the command accepts parameters, they can be passed inside the `params` array. See Also: [important directories](https://lbry.io/faq/lbry-directories). - -## Python - -Here is an example script to get the documentation for the various API calls. -To use any of the functions displayed, just provide any specified arguments in a dictionary. - - import sys - from jsonrpc.proxy import JSONRPCProxy - - try: - from lbrynet.conf import API_CONNECTION_STRING - except: - print "You don't have lbrynet installed!" - sys.exit(0) - - api = JSONRPCProxy.from_url(API_CONNECTION_STRING) - if not api.is_running(): - print api.daemon_status() - else: - for func in api.help(): - print "%s:\n%s" % (func, api.help({'function': func})) diff --git a/content/faq/benefit-consumers.md b/content/faq/benefit-consumers.md index 8b937d1f..9de6f92a 100644 --- a/content/faq/benefit-consumers.md +++ b/content/faq/benefit-consumers.md @@ -1,6 +1,7 @@ --- title: How does LBRY benefit content consumers? Why should I bother caring? category: LBRY 101 +order: 2 --- Do you watch YouTube? Imagine paying a few cents to eliminate all ads. 100% of the payment will go directly to the content creator – and they’ll still be earning more than YouTube offers, so they’ll want to make even more of the content you love. diff --git a/content/faq/custom-ui.md b/content/faq/custom-ui.md deleted file mode 100644 index 5c280434..00000000 --- a/content/faq/custom-ui.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: How do I specify a web-UI to use? -category: developer ---- - -If the files for the UI you'd like to use are stored locally on your computer, start LBRY with the `--ui` flag: - - lbrynet-daemon --ui=/full/path/to/ui/files/root/folder - -Once set with the UI flag, the given UI will be cached by LBRY and used as the default going forward. Also, LBRY will only successfully load a UI if the UI contains a conforming requirements.txt file to specify the required versions of lbrynet and lbryum. [Here](https://github.com/lbryio/lbry-web-ui/blob/master/dist/requirements.txt) is an example requirements.txt file. - -To reset your UI to pull from lbryio, or to try a UI still in development, run LBRY with the `--branch` flag: - - lbrynet-daemon --branch=master diff --git a/content/faq/development-status.md b/content/faq/development-status.md index 75ee1742..ae66e18a 100644 --- a/content/faq/development-status.md +++ b/content/faq/development-status.md @@ -1,6 +1,6 @@ --- title: What is LBRY’s development status right now? Plans for the future? -category: LBRY 101 +category: developer --- LBRY is currently in invite-only beta, with desktop apps for Linux, MacOS, and a pre-release version of Windows. There are approximately 5K active users and hundreds of content creators. The network already hosts big name content like the [feature film *It’s A Disaster*](https://lbry.io/news/launch-a-disaster) and videos from [Adult Swim’s MillionDollarExtreme](https://lbry.io/news/mde-on-lbry). We announce new featured content every Thursday on our [blog](https://lbry.io/news), [Twitter](https://twitter.com/lbryio), and [Facebook](https://www.facebook.com/lbryio). diff --git a/content/faq/is-lbry-open-source.md b/content/faq/is-lbry-open-source.md index a1da7684..0c2989cc 100644 --- a/content/faq/is-lbry-open-source.md +++ b/content/faq/is-lbry-open-source.md @@ -1,6 +1,6 @@ --- -title: Is LBRY Open Source? -category: other +title: Is LBRY open source? +category: developer --- -All of the code we have written for LBRY is open source - even this very website! You can access it on [GitHub](https://github.com/lbryio/). +All of the code we have written for LBRY is open source and MIT licensed - even this very website! You can access it on [GitHub](https://github.com/lbryio/). diff --git a/content/faq/lbry-name.md b/content/faq/lbry-name.md index e1134fb0..aa8a82f2 100644 --- a/content/faq/lbry-name.md +++ b/content/faq/lbry-name.md @@ -1,6 +1,7 @@ --- title: What’s with the name LBRY? category: LBRY 101 +order: 4 --- The very first question of newcomers is often, “How do you pronounce it?” Answer: library. diff --git a/content/faq/lbry-revenue.md b/content/faq/lbry-revenue.md index 79d8afea..3b590b74 100644 --- a/content/faq/lbry-revenue.md +++ b/content/faq/lbry-revenue.md @@ -1,6 +1,6 @@ --- title: How does the company behind LBRY make money? -category: LBRY 101 +category: other --- The LBRY protocol has a built-in digital currency that allows it to function, called LBRY credits. These credits are very similar to bitcoins. Having a built-in digital currency creates an opportunity for a new kind of business that has never existed: [the protocol-first enterprise](https://medium.com/the-coinbase-blog/app-coins-and-the-dawn-of-the-decentralized-business-model-8b8c951e734f#.6mr8znoiu). LBRY Inc. has reserved 10% of all LBRY credits to fund continued development and provide profit for the founders. Since credits only gain value as the use of the protocol grows, the company has an incentive to continue developing this open-source project. And we can do it all without taking a percentage of anyone’s transactions. diff --git a/content/faq/make-money.md b/content/faq/make-money.md index 065200ce..00c8ea77 100644 --- a/content/faq/make-money.md +++ b/content/faq/make-money.md @@ -1,6 +1,6 @@ --- title: How does LBRY benefit content creators? Can I make money using LBRY? -category: LBRY 101 +category: other --- In our AMA title, we pitched LBRY as a “community-driven” YouTube alternative that could “save the internet.” That’s a lot of big talk, but what does it mean for the people who care most about the changes happening at YouTube – content creators? diff --git a/content/faq/naming.md b/content/faq/naming.md index b2fa7584..e86471f1 100644 --- a/content/faq/naming.md +++ b/content/faq/naming.md @@ -1,6 +1,7 @@ --- title: How does LBRY naming work? Why don’t you just assign names the same way as internet domains? category: LBRY 101 +order: 5 --- First, since there have been a lot of misconceptions about how LBRY URLs work, **it is absolutely possible to own and control a URL forever**. That is the tl;dr of this post if you don't want to read a bunch of words about how LBRY URLs work. diff --git a/content/faq/what-is-lbry.md b/content/faq/what-is-lbry.md index 66f0ff15..b337d527 100644 --- a/content/faq/what-is-lbry.md +++ b/content/faq/what-is-lbry.md @@ -1,20 +1,21 @@ --- title: What is LBRY exactly – is it a protocol, an app, a website, a company? category: LBRY 101 +order: 1 --- LBRY is many components working together. For most users, it will just be a place where they can find great videos, music, ebooks, and more. A vast digital library available on all of your devices. -But behind that experience is an ecosystem that can be hard to understand at first – especially because we tend to refer to all the pieces and the system-as-a-whole as “LBRY”. (We’re working on clearing that up.) +But behind that experience is an ecosystem that can be hard to understand at first – especially because we tend to refer to all the pieces and the system-as-a-whole as “LBRY”. (We’re working on clearing that up.) It might be easier to start with what LBRY is not: it is not just another corporate media service like YouTube or iTunes or Spotify. It is first and foremost a new *protocol* that allows artists to upload their content to a network of hosts (like BitTorrent) and set a price per stream or download (like iTunes) or give it away for free (like YouTube without ads). What makes this all possible is the blockchain technology developed by the founder of Bitcoin. Do you have to understand any of this to use and enjoy LBRY? No. Does it still matter to users? Yes! Gmail has built an extremely popular email service on top of the near-universal *SMTP protocol* that everyone uses to exchange emails. Anyone sending email with SMTP can communicate with Gmail addresses, no matter what email platform they use (Yahoo!, AOL, iCloud, etc.). Google can’t interfere with someone emailing from an @yahoo.com address to an @aol.com address – and users are free to switch between services at any time, taking their emails with them. Users have a lot of power in open protocols that is often taken for granted. -Compare this to a proprietary, centrally controlled service like Facebook Messenger. If you conduct all of your social communications via Messenger, you’re stuck in that environment – you cannot move your messages or contacts over to Google Chat or Skype. And if Facebook changes the way Messenger functions by censoring conversations or sharing your information with advertisers or governments, tough luck. +Compare this to a proprietary, centrally controlled service like Facebook Messenger. If you conduct all of your social communications via Messenger, you’re stuck in that environment – you cannot move your messages or contacts over to Google Chat or Skype. And if Facebook changes the way Messenger functions by censoring conversations or sharing your information with advertisers or governments, tough luck. -Even platforms that are ostensibly designed with the user’s control and privacy in mind are susceptible to corruption if they are centrally controlled. WhatsApp comes to mind. WhatsApp built a huge global user base claiming to put users above advertisers. Then Facebook bought it. Now users may well have their personal phone numbers and metadata mined for Facebook’s advertising algorithms. +Even platforms that are ostensibly designed with the user’s control and privacy in mind are susceptible to corruption if they are centrally controlled. WhatsApp comes to mind. WhatsApp built a huge global user base claiming to put users above advertisers. Then Facebook bought it. Now users may well have their personal phone numbers and metadata mined for Facebook’s advertising algorithms. -There is no such risk of top-down corruption with the LBRY protocol. Content uploaded to the decentralized LBRY network remains publicly accessible so long as the community finds it valuable and continues to host it. +There is no such risk of top-down corruption with the LBRY protocol. Content uploaded to the decentralized LBRY network remains publicly accessible so long as the community finds it valuable and continues to host it. Now, the LBRY project is more than just a revolutionary new protocol. It is also a company, *LBRY Inc.*, which is developing a *LBRY app* to allow users to easily interact with the protocol. So it’s as if Google had developed the email protocol, released it to the world for free, and then built Gmail to help people make use of it. Not only is our app completely open-source, but others are welcome to create competing apps that also use the LBRY protocol. For a content creator, your uploaded content will be available to all of these apps at the same time. diff --git a/content/faq/why-care-about-lbry.md b/content/faq/why-care-about-lbry.md deleted file mode 100644 index 92bd6e36..00000000 --- a/content/faq/why-care-about-lbry.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Why should I care about LBRY if I can’t even use it yet? -category: LBRY 101 ---- -A lot of people won’t care about LBRY until it can deliver them immediate benefits. That’s fair and we understand. - -The advantage of getting involved right now is the same as following a local band that you’d like to see make it big. You have the opportunity to have very direct contact with our dev team. You can make suggestions and shape the course of LBRY. You can [earn bounties](https://lbry.io/bounty) for helping to build and promote LBRY. You can connect with our truly amazing community of people, like [Javier from Venezuela who says LBRY gave him new hope for life](https://lbry.io/news/day-in-shoes-venezuelan). You can [post your content to the network](https://lbry.io/publish) before it is mainstream and get attention and appreciation from our early adopters – not to mention a possible prize of $1000 in LBC. - -Or get involved because it’s rare to get an opportunity to be part of a project that could reshape the fabric of the internet and creative media for years to come. - -*Did this FAQ address your concerns? Still think we’re full of it? Sound off at [reddit.com/r/lbry/](https://www.reddit.com/r/lbry/). Thank you for taking the time to learn about LBRY!* - -**Not on LBRY yet?** [Get an invite here](https://lbry.io/get). Just can’t wait? If you’re a creator, skip our waiting list line for a chance to earn $1,000 in LBRY Credits at the same time. [Learn more here](https://lbry.io/publish). diff --git a/controller/Controller.class.php b/controller/Controller.class.php index a7850660..d5888186 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -118,6 +118,7 @@ class Controller '/why' => '/learn', '/feedback' => '/learn', '/faq/when-referral-payouts' => '/faq/referrals', + '/faq/why-care-about-lbry' => '/get', '/news/meet-the-lbry-founders' => '/team', '/faq/no-auction-options' => '/faq/naming', '/join-list' => '/list/subscribe', diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index 562f0a66..b748daaf 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -79,12 +79,12 @@ class ContentActions extends Actions if (!$slug) { - $allPosts = Post::find(static::VIEW_FOLDER_FAQ); + $allPosts = Post::find(static::VIEW_FOLDER_FAQ, Post::SORT_ORD_ASC); $allCategories = [ + 'LBRY 101' => 'Intro to LBRY', 'getstarted' => 'Getting Started', 'setup' => 'Installing and Running LBRY', - 'LBRY 101' => 'LBRY 101', 'wallet' => 'The LBRY Wallet', 'mining' => 'Mining LBC', 'policy' => 'Policies', @@ -120,7 +120,7 @@ class ContentActions extends Actions } catch (PostNotFoundException $e) { - return NavActions::execute404(); + return Controller::redirect('/' . static::SLUG_FAQ); } return ['content/faq-post', ['post' => $post]]; } diff --git a/model/Post.class.php b/model/Post.class.php index 7c1c106a..2f71744a 100644 --- a/model/Post.class.php +++ b/model/Post.class.php @@ -6,7 +6,8 @@ class PostMalformedException extends Exception {} class Post { - const SORT_DATE_DESC = 'sort_date_desc'; + const SORT_DATE_DESC = 'sort_date_desc', + SORT_ORD_ASC = 'sort_ord_asc'; protected static $slugMap = []; protected $slug, $title, $metadata, $author, $date, $markdown, $contentText, $contentHtml, $cover, $postType, $category; @@ -80,6 +81,22 @@ class Post return strcasecmp($b->getDate()->format('Y-m-d'), $a->getDate()->format('Y-m-d')); }); break; + + case static::SORT_ORD_ASC: + usort($posts, function(Post $a, Post $b) { + $aMeta = $a->getMetadata(); + $bMeta = $b->getMetadata(); + if (!isset($aMeta['order']) && !isset($bMeta['order'])) + { + return $a->getTitle() < $b->getTitle() ? -1 : 1; + } + if (isset($aMeta['order']) && isset($bMeta['order'])) + { + return $aMeta['order'] < $bMeta['order'] ? -1 : 1; + } + return isset($aMeta['order']) ? -1 : 1; + }); + break; } } return $posts;