├── .gitignore ├── README.md ├── app ├── autoload.php ├── bash │ ├── chown.php │ ├── composer.php │ ├── install │ ├── install.php │ ├── locale.php │ ├── restart.php │ ├── update.php │ └── utils.php ├── css │ ├── font-awesome │ │ ├── HELP-US-OUT.txt │ │ ├── css │ │ │ ├── font-awesome.css │ │ │ └── font-awesome.min.css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ ├── less │ │ │ ├── animated.less │ │ │ ├── bordered-pulled.less │ │ │ ├── core.less │ │ │ ├── fixed-width.less │ │ │ ├── font-awesome.less │ │ │ ├── icons.less │ │ │ ├── larger.less │ │ │ ├── list.less │ │ │ ├── mixins.less │ │ │ ├── path.less │ │ │ ├── rotated-flipped.less │ │ │ ├── screen-reader.less │ │ │ ├── stacked.less │ │ │ └── variables.less │ │ └── scss │ │ │ ├── _animated.scss │ │ │ ├── _bordered-pulled.scss │ │ │ ├── _core.scss │ │ │ ├── _fixed-width.scss │ │ │ ├── _icons.scss │ │ │ ├── _larger.scss │ │ │ ├── _list.scss │ │ │ ├── _mixins.scss │ │ │ ├── _path.scss │ │ │ ├── _rotated-flipped.scss │ │ │ ├── _screen-reader.scss │ │ │ ├── _stacked.scss │ │ │ ├── _variables.scss │ │ │ └── font-awesome.scss │ ├── frame.css │ └── style.css ├── frame.php ├── images │ ├── backgrounds │ │ ├── default-01.jpg │ │ ├── default-02.jpg │ │ ├── default-03.jpg │ │ ├── default-04.jpg │ │ ├── default-05.jpg │ │ └── default-06.jpg │ ├── logo-text.svg │ ├── logo.svg │ └── readme_header.png ├── index.php ├── js │ ├── anime.min.js │ ├── frame.js │ ├── index.js │ ├── index.loop.js │ ├── moment-with-locales.js │ ├── navigo.min.js │ └── pace.min.js ├── locale │ ├── de │ │ └── LC_MESSAGES │ │ │ └── steemPi.po │ ├── en │ │ └── LC_MESSAGES │ │ │ └── steemPi.po │ └── nl │ │ └── LC_MESSAGES │ │ └── steemPi.po ├── src │ └── SteemPi │ │ ├── Config.php │ │ ├── Exception.php │ │ ├── GPIO.php │ │ ├── LEDS.php │ │ ├── Menu │ │ └── Item.php │ │ ├── Modules │ │ ├── Handler.php │ │ └── Module.php │ │ └── SteemPi.php └── tests │ ├── gpio.php │ ├── ledtest.php │ └── run.php ├── case (3d models) ├── full case │ └── by lextenebris │ │ └── 2018 01 │ │ ├── Standard │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── SteemPi Bottom Case.step │ │ ├── SteemPi Bottom Plate.stl │ │ ├── SteemPi Top Case.step │ │ ├── SteemPi Top Plate.stl │ │ ├── SteemPi_Top_Case_un-VESA%27d_2017-Dec-19_06-02-13PM-000_CustomizedView27519844442.png │ │ ├── SteemPi_Top_Case_un-VESA%27d_2017-Dec-19_06-13-05PM-000_CustomizedView22353338303.png │ │ ├── SteemPi_Top_Case_un-VESA%27d_2017-Dec-19_06-25-33PM-000_CustomizedView15145494748.png │ │ ├── SteemPi_Top_Case_un-VESA%27d_2017-Dec-19_07-02-47PM-000_CustomizedView22613793973.png │ │ ├── SteemPi_Top_Case_un-VESA%27d_2017-Dec-19_07-28-53PM-000_CustomizedView28240694750.png │ │ └── SteemPi_Top_Case_un-VESA%27d_2017-Dec-19_07-36-11PM-000_CustomizedView15712030720.png │ │ └── Vertical │ │ ├── SteemPi Bottom Case Standing.f3d │ │ ├── SteemPi Bottom Case Standing.step │ │ ├── SteemPi Bottom Case Standing.stl │ │ ├── SteemPi Top Case Standing.f3d │ │ ├── SteemPi Top Case Standing.step │ │ ├── SteemPi Top Case Standing.stl │ │ ├── SteemPi_Case_%28Standing%29_2018-Jan-02_03-54-12PM-000_CustomizedView14738632598.png │ │ ├── SteemPi_Case_%28Standing%29_2018-Jan-02_04-08-18PM-000_CustomizedView3218308360.png │ │ ├── SteemPi_Case_%28Standing%29_2018-Jan-02_04-11-14PM-000_CustomizedView10689853559.png │ │ ├── SteemPi_Case_%28Standing%29_2018-Jan-02_05-35-22PM-000_CustomizedView183663004.png │ │ ├── SteemPi_Case_%28Standing%29_2018-Jan-02_05-45-42PM-000_CustomizedView22939140683.png │ │ ├── SteemPi_Case_%28Standing%29_2018-Jan-02_05-50-39PM-000_CustomizedView7317596350.png │ │ └── SteemPi_Case_%28Standing%29_2018-Jan-02_09-09-16AM-000_CustomizedView27585120167.png └── side panel │ ├── by lextenebris │ └── 2017 12 12 │ │ ├── SteemPi Side Panel Body (SquidVer).step │ │ ├── SteemPi Side Panel Body (SquidVer).stl │ │ ├── SteemPi Side Panel Body.step │ │ ├── sp16.png │ │ ├── sp17.png │ │ └── sp18.png │ └── giveaway │ ├── SidePanelSteemPi │ ├── 2D SteemPi Side Panel for plastic case - Linedrawing (vector).ai │ ├── 2D SteemPi Side Panel for plastic case - Linedrawing.jpg │ ├── 3D SteemPi Side Panel for plastic case - Steem logo cutout.skp │ └── 3D SteemPi Side Panel for plastic case - Steem logo cutout.stl │ ├── index.html │ ├── index.js │ └── index.png ├── composer.json ├── composer.lock ├── favicon.ico ├── index.php ├── install ├── js └── index.js ├── ledscript ├── ledscript-orangepi-h3soc.sh ├── ledscript.sh ├── new.html └── old.html ├── modules ├── MontereyBayAquarium │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── Steemitpond │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── WhaleSonar │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── bitcoinexplorer │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── discord │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── dtube │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── duckduckgo │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── feed │ ├── css │ │ ├── feed.css │ │ ├── gutenberg.css │ │ ├── post.css │ │ └── style.css │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ ├── js │ │ ├── feed.js │ │ ├── fetch.js │ │ └── post.js │ ├── locale │ │ ├── de │ │ │ └── LC_MESSAGES │ │ │ │ ├── feed.mo │ │ │ │ └── feed.po │ │ └── en │ │ │ └── LC_MESSAGES │ │ │ ├── feed.mo │ │ │ └── feed.po │ ├── markdown.php │ ├── module.json │ ├── post.php │ └── utils.php ├── issLive │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── openhab │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── raspberrypiorg │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── settings │ ├── compile.php │ ├── css │ │ └── style.css │ ├── images │ │ ├── ledblue.svg │ │ ├── ledgreen.svg │ │ └── ledpurple.svg │ ├── index.php │ ├── javascript │ │ └── settings.js │ ├── locale │ │ ├── de │ │ │ └── LC_MESSAGES │ │ │ │ ├── settings.mo │ │ │ │ └── settings.po │ │ ├── en │ │ │ └── LC_MESSAGES │ │ │ │ ├── settings.mo │ │ │ │ └── settings.po │ │ └── nl │ │ │ └── LC_MESSAGES │ │ │ ├── settings.mo │ │ │ └── settings.po │ ├── module.json │ └── save.php ├── spectacles │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── stats │ ├── css │ │ └── style.css │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ ├── locale │ │ ├── de │ │ │ └── LC_MESSAGES │ │ │ │ ├── stats.mo │ │ │ │ └── stats.po │ │ └── en │ │ │ └── LC_MESSAGES │ │ │ ├── stats.mo │ │ │ └── stats.po │ └── module.json ├── steemstream │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json ├── steemsupply │ ├── images │ │ ├── icon.svg │ │ └── menu.svg │ ├── index.php │ └── module.json └── tedcom │ ├── images │ ├── icon.svg │ └── menu.svg │ ├── index.php │ └── module.json └── steempi /.gitignore: -------------------------------------------------------------------------------- 1 | conf/ 2 | vendor/ 3 | .idea/ 4 | etc/ 5 | /backgrounds/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SteemPi 2 | ====== 3 | 4 |
5 | 6 | ![SteemPi Version 2.0](app/images/readme_header.png) 7 | 8 |
9 | 10 | STEEMPI V2.0 | Steemit LED light notifications and web interface for Raspberry Pi 11 | and other Raspberry Pi clones that uses the Wirringpi GPIO library. 12 | 13 | SteemPi shows its interface on a connected TV (HDMI), 14 | but you can also view the interface with a web browser on mobile devices, laptops, pc, game consoles, smartwatches 15 | and other devices that are capable of browsing web pages. 16 | 17 | SteemPi is made by: 18 | 19 | - @techtek - https://steemit.com/@techtek 20 | - @dehenne - https://steemit.com/@dehenne 21 | 22 | 23 | Installation - How to make your Pi, Steem? 24 | ------ 25 | 26 | 27 | ### Step 1: Operating system 28 | 29 | Install the latest version of Raspbian on your SD card 30 | `https://www.raspberrypi.org/downloads/raspbian/` 31 | 32 | - Boot up the system and connect to your home network and the internet (Wifi or cable) 33 | - Enable SSH `Start > Preferences > Raspberry Pi Configuration > Interfaces > Enable ssh` 34 | - Login in via SSH 35 | 36 | 37 | ### Step 2: SteemPi Installation 38 | 39 | - `sudo su` 40 | - `mkdir /var/www/html -p` 41 | - `apt-get update` 42 | - `apt-get install git -y` 43 | - `cd /var/www/html` 44 | - `git clone https://github.com/techtek/steempi.git .` 45 | 46 | *If you want to install the dev version* 47 | 48 | - `git checkout dev` 49 | 50 | *You only have to start the installation :-)* 51 | 52 | - `./install` 53 | 54 | 55 | *It take a while* 56 | *The script installs SteemPi and keep your system up to date* 57 | *I recommend you to get a coffee* 58 | *;-)* 59 | 60 | 61 | ### Step 3: Steemit LED light notifications 62 | 63 | - Connect a LED to GPIO17 of the Pi 64 | (and you shoud solder the correct resistor to the LED. it works without one, 65 | no problems so far but you may damage the pi without one. 66 | 67 | - Make ledscript.sh executable, `cd /var/www/html/ledscript/` and use the command `sudo chmod u+x ledscript.sh` 68 | 69 | - To run the script manualy: `cd /var/www/html/ledscript/` and to run it, `sudo ./ledscript.sh` 70 | The LED should blink one time because it detected change. 71 | 72 | You can test if it is working by making a reply on my Steemit account `http://steemit.com/@techtek` 73 | This way you can test if your LED lights up, and it's a way to let me know you installed SteemPi. 74 | 75 | If the LED lights up, change `@techtek` in the script, 76 | to watch your account for updates to do this, use the commands: 77 | 78 | `cd /var/www/html/ledscript/` and to edit use the command 79 | `sudo nano ledscript.sh` edit the username in the URL and exit and save with, ctrl+x 80 | 81 | To make ledscript.sh boot on startup, 82 | `sudo nano /etc/rc.local` add in this file before exit 0 this line `/var/www/html/ledscript/./ledscript.sh` 83 | and exit and save with, ctrl+x 84 | 85 | 86 | Everything is now ready to use! 87 | ------ 88 | 89 | If you make changes to the SteemPi project, 90 | please do share them back to the SteemPi project so others can use those functionalities as well. 91 | 92 | - https://github.com/techtek/steempi 93 | - https://steemit.com/@techtek 94 | - https://steemit.com/@dehenne 95 | 96 | Please support the makers of the services that are integrated into SteemPi. 97 | 98 | If you have a service or functionality you want to integrate, 99 | you could help by writing a custom code for your service that can be implemented in the SteemPi web interface. 100 | 101 | 102 | -------------------------------------------------------------------------------- /app/autoload.php: -------------------------------------------------------------------------------- 1 | setPsr4('SteemPi\\', __DIR__.'/src/SteemPi/'); 8 | 9 | /** 10 | * Localization 11 | * 12 | * msgfmt xxx.po -o xxx.mo 13 | */ 14 | 15 | \SteemPi\SteemPi::loadLanguage(); 16 | -------------------------------------------------------------------------------- /app/bash/chown.php: -------------------------------------------------------------------------------- 1 | /dev/null 2>&1 || { 14 | echo ""; 15 | echo "No PHP is installed. I will install php7 for you."; 16 | echo ""; 17 | 18 | command echo "deb http://httpredir.debian.org/debian stretch main contrib non-free" | tee /etc/apt/sources.list.d/debian-stretch.list 19 | 20 | command gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553 21 | command gpg -a --export 8B48AD6246925553 | sudo apt-key add - 22 | 23 | command apt-key update 24 | command apt-get update -y --allow-unauthenticated 25 | command apt-get install php7.0 php7.0-fpm php7.0-mbstring -t stretch -y --allow-unauthenticated 26 | 27 | command rm /etc/apt/sources.list.d/debian-stretch.list 28 | command apt-get update -y --allow-unauthenticated 29 | } 30 | 31 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 32 | command php ${DIR}/install.php -------------------------------------------------------------------------------- /app/bash/install.php: -------------------------------------------------------------------------------- 1 | /dev/null < (( 37 | "socket" => "/var/run/php/php7.0-fpm.sock" 38 | ))) 39 | EOF' 40 | ); 41 | 42 | system('lighttpd-enable-mod fastcgi'); 43 | system('/etc/init.d/lighttpd force-reload'); 44 | } 45 | 46 | if (!command_exist('gpio')) { 47 | echo PHP_EOL; 48 | echo "No GPIO connection is installed. I will install wiringpi for you.".PHP_EOL; 49 | system('apt-get install wiringpi -y'); 50 | 51 | } 52 | 53 | if (!function_exists('mb_substr()')) { 54 | system('apt-get php7.0-mbstring -y'); 55 | } 56 | 57 | // SteemPi 58 | echo "Now i will install SteemPi for you.".PHP_EOL; 59 | 60 | chdir($dir); 61 | 62 | if (file_exists('/var/www/html/index.lighttpd.html')) { 63 | unlink('/var/www/html/index.lighttpd.html'); 64 | } 65 | 66 | system('apt-get update -y'); 67 | system('git clone https://github.com/techtek/steempi.git .'); 68 | 69 | // checkout dev 70 | system('git checkout -b dev origin/dev'); 71 | 72 | // composer 73 | include 'composer.php'; 74 | 75 | // create etc folder 76 | if (!is_dir($dir.'/etc/')) { 77 | mkdir($dir.'/etc/'); 78 | 79 | $conf = ' 80 | ; 81 | 82 | [steempi] 83 | language = "en_EN" 84 | modulesOrder = "feed,dtube,spectacles,steemstream,steemsupply,discord,WhaleSonar,Steemitpond,stats,issLive,bitcoinexplorer,duckduckgo,MontereyBayAquarium,openhab,raspberrypiorg,tedcom,settings" 85 | 86 | [steemit] 87 | username = "" 88 | 89 | [modules] 90 | feed = 1 91 | issLive = 0 92 | settings = 1 93 | stats = 1 94 | Steemitpond = 1 95 | WhaleSonar = 1 96 | discord = 1 97 | bitcoinexplorer = 0 98 | dtube = 1 99 | duckduckgo = 0 100 | MontereyBayAquarium = 0 101 | openhab = 0 102 | raspberrypiorg = 0 103 | spectacles = 1 104 | steemstream = 1 105 | steemsupply = 1 106 | tedcom = 0 107 | 108 | '; 109 | 110 | file_put_contents($dir.'/etc/conf.ini.php', $conf); 111 | } 112 | 113 | if (!class_exists('\Locale')) { 114 | if (version_compare(PHP_VERSION, '7.0.0') >= 0) { 115 | system('apt-get install php7.0-intl -y'); 116 | } else { 117 | system('apt-get install php5-intl -y'); 118 | } 119 | } 120 | 121 | $dir = dirname(dirname(dirname(__FILE__))); 122 | 123 | system($dir.'/steempi update'); 124 | -------------------------------------------------------------------------------- /app/bash/locale.php: -------------------------------------------------------------------------------- 1 | = 0) { 52 | system('apt-get install php7.0-intl -y'); 53 | } else { 54 | system('apt-get install php5-intl -y'); 55 | } 56 | } 57 | 58 | \cli\Colors::enable(); 59 | \cli\line('%CGenerate locale%n', true); 60 | \cli\Colors::disable(); 61 | include dirname(__FILE__).'/locale.php'; 62 | 63 | 64 | \cli\Colors::enable(); 65 | \cli\line('%CUpdate PHP libraries%n', true); 66 | \cli\Colors::disable(); 67 | include dirname(__FILE__).'/composer.php'; 68 | 69 | \cli\Colors::enable(); 70 | \cli\line('%CSet folder permissions%n', true); 71 | \cli\Colors::disable(); 72 | include dirname(__FILE__).'/chown.php'; 73 | 74 | \cli\Colors::enable(); 75 | \cli\line('%CRestart services%n', true); 76 | \cli\Colors::disable(); 77 | include dirname(__FILE__).'/restart.php'; 78 | 79 | echo PHP_EOL; 80 | echo PHP_EOL; 81 | echo "I am done. We wish you a lot of fun with SteemPi - @dehenne and @Techtek"; 82 | echo PHP_EOL; 83 | -------------------------------------------------------------------------------- /app/bash/utils.php: -------------------------------------------------------------------------------- 1 | li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/css/font-awesome/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | .fa-icon-rotate(@degrees, @rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; 16 | -webkit-transform: rotate(@degrees); 17 | -ms-transform: rotate(@degrees); 18 | transform: rotate(@degrees); 19 | } 20 | 21 | .fa-icon-flip(@horiz, @vert, @rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; 23 | -webkit-transform: scale(@horiz, @vert); 24 | -ms-transform: scale(@horiz, @vert); 25 | transform: scale(@horiz, @vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | .sr-only() { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | .sr-only-focusable() { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/css/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /app/css/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /app/css/font-awesome/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /app/css/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | @mixin fa-icon-rotate($degrees, $rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})"; 16 | -webkit-transform: rotate($degrees); 17 | -ms-transform: rotate($degrees); 18 | transform: rotate($degrees); 19 | } 20 | 21 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)"; 23 | -webkit-transform: scale($horiz, $vert); 24 | -ms-transform: scale($horiz, $vert); 25 | transform: scale($horiz, $vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | @mixin sr-only { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | @mixin sr-only-focusable { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /app/css/font-awesome/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /app/css/frame.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | 5 | box-sizing: border-box; 6 | -moz-box-sizing: border-box; 7 | -webkit-box-sizing: border-box; 8 | } 9 | 10 | html { 11 | height: 100%; 12 | width: 100%; 13 | } 14 | 15 | body { 16 | background: transparent; 17 | background-size: cover; 18 | color: #18191b; 19 | float: left; 20 | font-family: "Open Sans", sans-serif; 21 | font-weight: 400; 22 | font-size: 15px; 23 | height: 100%; 24 | width: 100%; 25 | } 26 | 27 | header { 28 | float: left; 29 | max-width: 100%; 30 | padding: 30px 0 20px 60px; 31 | position: relative; 32 | width: 100%; 33 | } 34 | 35 | header img { 36 | float: left; 37 | height: 100px; 38 | max-width: 100%; 39 | } 40 | 41 | header .logo { 42 | float: left; 43 | height: 70px; 44 | left: -70px; 45 | position: relative; 46 | top: 18px; 47 | } 48 | 49 | header time { 50 | color: #ffffff; 51 | opacity: 0; 52 | position: absolute; 53 | right: 70px; 54 | text-shadow: 1px 1px 5px #333333; 55 | top: 50px; 56 | } 57 | 58 | header time .time { 59 | display: block; 60 | font-size: 2.5em; 61 | text-align: right; 62 | } 63 | 64 | header time .date { 65 | clear: both; 66 | display: block; 67 | font-size: 1em; 68 | text-align: right; 69 | } 70 | 71 | /** Content 72 | =============================================== */ 73 | 74 | .content { 75 | clear: both; 76 | height: calc(100% - 500px); 77 | padding: 0 40px; 78 | width: 100%; 79 | } 80 | 81 | .content .feed-tile { 82 | max-width: 360px; 83 | } 84 | 85 | .content .feed-tile header { 86 | padding: 0; 87 | } 88 | 89 | /** Module listing 90 | =============================================== */ 91 | 92 | .modules { 93 | float: left; 94 | padding: 30px 60px 20px 60px; 95 | width: 100%; 96 | } 97 | 98 | .modules-module { 99 | cursor: pointer; 100 | float: left; 101 | overflow: hidden; 102 | margin: 2px; 103 | opacity: 0; 104 | position: relative; 105 | top: 20px; 106 | transition: box-shadow .1s ease-out, transform .1s ease-out; 107 | transition-delay: .1s; 108 | width: calc(100% / 7); 109 | } 110 | 111 | .modules-module:hover { 112 | /*box-shadow: rgba(32, 32, 32, 0.05) 0 16px 16px;*/ 113 | /*outline: 1px solid #DEDEDE;*/ 114 | transform: translate(0, -4px); 115 | } 116 | 117 | .modules-module:after { 118 | display: block; 119 | content: ''; 120 | padding-top: 56.25%; 121 | } 122 | 123 | .modules-module img { 124 | background: #fff; 125 | max-height: 100%; 126 | position: absolute; 127 | width: 100%; 128 | } 129 | 130 | @media (max-width: 1400px) { 131 | .modules-module { 132 | width: calc(100% / 6); 133 | } 134 | } 135 | 136 | @media (max-width: 1100px) { 137 | .modules-module { 138 | width: calc(100% / 4 - 4px); 139 | } 140 | } 141 | 142 | @media (max-width: 900px) { 143 | .modules-module { 144 | width: calc(100% / 3 - 4px); 145 | } 146 | } 147 | 148 | @media (max-width: 480px) { 149 | .modules { 150 | padding: 30px 10px 20px 10px; 151 | } 152 | 153 | .modules-module { 154 | width: calc(100% / 2 - 4px); 155 | } 156 | } 157 | 158 | @media (max-width: 660px) { 159 | header time { 160 | display: none; 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /app/css/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | 5 | box-sizing: border-box; 6 | -moz-box-sizing: border-box; 7 | -webkit-box-sizing: border-box; 8 | } 9 | 10 | html { 11 | height: 100%; 12 | width: 100%; 13 | } 14 | 15 | body { 16 | background-color: #f5f5f5; 17 | background-position: center center; 18 | background-repeat: no-repeat; 19 | background-size: cover; 20 | color: #18191b; 21 | font-family: "Open Sans", sans-serif; 22 | font-weight: 400; 23 | font-size: 15px; 24 | height: 100%; 25 | } 26 | 27 | /** Navigation 28 | =============================================== */ 29 | 30 | header { 31 | background: rgba(255, 255, 255, 0.5); 32 | border-bottom: 1px solid #dedede; 33 | color: #fff; 34 | padding-left: 60px; 35 | position: fixed; 36 | top: 0; 37 | height: 60px; 38 | width: 100%; 39 | z-index: 90; 40 | } 41 | 42 | .header-buttons { 43 | text-align: right; 44 | } 45 | 46 | .header-buttons-button { 47 | display: inline-block; 48 | color: #18191b; 49 | cursor: pointer; 50 | font-size: 16px; 51 | line-height: 60px; 52 | padding: 0 20px; 53 | text-decoration: none; 54 | } 55 | 56 | .header-buttons-button.active { 57 | background: #bbbbbb; 58 | } 59 | 60 | .header-buttons-button:hover { 61 | background: #dedede; 62 | color: #18191b; 63 | } 64 | 65 | /** Header Navigation 66 | =============================================== */ 67 | 68 | .header-menu { 69 | cursor: pointer; 70 | left: 0; 71 | outline: none; 72 | position: absolute; 73 | width: 60px; 74 | } 75 | 76 | .header-menu img { 77 | margin: 16px 0 0 10px; 78 | width: 40px; 79 | } 80 | 81 | /** Navigation 82 | =============================================== */ 83 | 84 | nav { 85 | background: rgba(255, 255, 255, 0.5); 86 | border-right: 1px solid #dedede; 87 | height: 100%; 88 | left: 0; 89 | outline: none; 90 | overflow: hidden; 91 | position: fixed; 92 | top: 0; 93 | width: 60px; 94 | will-change: transition; 95 | z-index: 100; 96 | 97 | transition: width .2s, box-shadow 0.1s linear 0.1s; 98 | -webkit-transition: width .2s, box-shadow .1s linear .1s; 99 | } 100 | 101 | .nav-opened { 102 | background: #f5f5f5; 103 | box-shadow: 3px 0 20px rgba(0, 0, 0, 0.2); 104 | width: 300px; 105 | will-change: width; 106 | 107 | transition: width .2s, box-shadow 0.1s linear .1s; 108 | -webkit-transition: width .2s, box-shadow .1s linear .1s; 109 | } 110 | 111 | nav .steemPi-logo { 112 | color: #999; 113 | display: inline-block; 114 | font-size: 30px; 115 | line-height: 60px; 116 | height: 56px; 117 | text-align: center; 118 | width: 300px; 119 | } 120 | 121 | nav .steemPi-logo img.logo { 122 | float: left; 123 | margin: 16px 0 0 10px; 124 | width: 40px; 125 | } 126 | 127 | nav .steemPi-logo img.logo-text { 128 | float: left; 129 | margin: 14px 0 0 8px; 130 | width: 140px; 131 | } 132 | 133 | .navigation { 134 | border-top: 1px solid #dedede; 135 | height: calc(100% - 60px); 136 | margin: 0; 137 | overflow: hidden; 138 | overflow-y: auto; 139 | padding: 0; 140 | width: 300px; 141 | } 142 | 143 | .navigation li { 144 | list-style: none; 145 | } 146 | 147 | .navigation-entry a { 148 | display: inline-block; 149 | color: #666666; 150 | padding: 15px 0; 151 | width: 100%; 152 | } 153 | 154 | .navigation-entry a:hover { 155 | background: #dedede; 156 | } 157 | 158 | .navigation-entry .menuItem-icon { 159 | display: inline-block; 160 | float: left; 161 | font-size: 28px; 162 | line-height: 30px; 163 | text-align: center; 164 | width: 60px; 165 | } 166 | 167 | .navigation-entry .menuItem-icon img { 168 | border: 0; 169 | height: 100%; 170 | object-position: center; 171 | object-fit: cover; 172 | width: calc(100% - 30px); 173 | } 174 | 175 | .navigation-entry .menuItem-text { 176 | display: inline-block; 177 | line-height: 30px; 178 | float: left; 179 | width: calc(100% - 60px); 180 | } 181 | 182 | main { 183 | height: 100%; 184 | left: 0; 185 | padding: 60px 0 0 0; 186 | position: fixed; 187 | top: 0; 188 | width: 100%; 189 | z-index: 10; 190 | } 191 | 192 | main iframe { 193 | border: none; 194 | height: 100%; 195 | width: 100% 196 | } 197 | 198 | /** Pace - Loader Bar 199 | =============================================== */ 200 | 201 | .pace { 202 | -webkit-pointer-events: none; 203 | pointer-events: none; 204 | 205 | -webkit-user-select: none; 206 | -moz-user-select: none; 207 | user-select: none; 208 | } 209 | 210 | .pace-inactive { 211 | display: none; 212 | } 213 | 214 | .pace .pace-progress { 215 | background: #ee3148; 216 | position: fixed; 217 | z-index: 2000; 218 | top: 0; 219 | right: 100%; 220 | width: 100%; 221 | height: 2px; 222 | } -------------------------------------------------------------------------------- /app/frame.php: -------------------------------------------------------------------------------- 1 | getModules(); 11 | 12 | $Response = getFeed(4); 13 | $result = json_decode($Response->getBody(), true); 14 | $feed = $result['results']; 15 | 16 | if (count($feed) > 4) { 17 | $feed = array_slice($feed, 0, 4); 18 | } 19 | 20 | ?> 21 | 22 | 23 | 24 | STEEMPI | A system for Steemit 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 |
40 | 41 | 42 | 43 |
44 | 45 |
46 | 51 |
52 | 53 |
54 | isActive()) { 58 | continue; 59 | } 60 | 61 | if ($Module->getName() === 'settings') { 62 | continue; 63 | } 64 | 65 | ?> 66 |
67 | getIcon(); ?> 68 |
69 | 70 |
71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /app/images/backgrounds/default-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/images/backgrounds/default-01.jpg -------------------------------------------------------------------------------- /app/images/backgrounds/default-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/images/backgrounds/default-02.jpg -------------------------------------------------------------------------------- /app/images/backgrounds/default-03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/images/backgrounds/default-03.jpg -------------------------------------------------------------------------------- /app/images/backgrounds/default-04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/images/backgrounds/default-04.jpg -------------------------------------------------------------------------------- /app/images/backgrounds/default-05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/images/backgrounds/default-05.jpg -------------------------------------------------------------------------------- /app/images/backgrounds/default-06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/images/backgrounds/default-06.jpg -------------------------------------------------------------------------------- /app/images/logo-text.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 24 | 25 | 27 | 29 | 31 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/images/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/images/readme_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/images/readme_header.png -------------------------------------------------------------------------------- /app/index.php: -------------------------------------------------------------------------------- 1 | getModules(); 10 | $background = SteemPi\SteemPi::getBackground(); 11 | 12 | ?> 13 | 14 | 15 | 16 | 17 | 18 | 19 | STEEMPI | A system for Steemit 20 | 21 | 22 | 23 | 24 | 25 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 | 64 | 65 |
66 |
67 | 68 |
69 | 70 |
71 | 72 | 73 | 74 | 75 |
76 | 77 |
78 | 79 | extendsTopMenu() || !$Module->isActive()) { 82 | continue; 83 | } 84 | 85 | $MenuItem = $Module->getTopMenu(); 86 | $MenuItem->addClass('header-buttons-button'); 87 | 88 | echo $MenuItem->create(); 89 | 90 | } ?> 91 |
92 |
93 | 94 |
95 | 96 |
97 |
98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /app/js/frame.js: -------------------------------------------------------------------------------- 1 | // animations 2 | (function () { 3 | document.body.style.float = 'left'; 4 | document.body.style.overflow = 'hidden'; 5 | document.body.style.width = '100%'; 6 | 7 | var modules = document.getElementsByClassName('modules-module'); 8 | 9 | for (var i = 0, len = modules.length; i < len; i++) { 10 | modules[i].addEventListener('click', function (event) { 11 | var Target = event.target; 12 | 13 | if (!Target.classList.contains('modules-module')) { 14 | Target = Target.parentNode; 15 | } 16 | 17 | window.parent.location = '/#!' + Target.getAttribute('data-module'); 18 | }); 19 | 20 | anime({ 21 | targets: modules[i], 22 | opacity: 1, 23 | top : 0, 24 | delay : i * 100, 25 | easing : 'easeInOutQuart' 26 | }); 27 | } 28 | 29 | // time 30 | var Time = document.querySelector('header time'); 31 | var setTime = function () { 32 | var html = ''; 33 | 34 | moment.locale(locale_code); 35 | 36 | html = html + '' + moment().format('HH:mm') + ''; 37 | html = html + '' + moment().format('dddd, MMMM Do') + ''; 38 | 39 | Time.innerHTML = html; 40 | 41 | document.body.style.overflow = ''; 42 | }; 43 | 44 | setInterval(setTime, 10000); 45 | setTime(); 46 | 47 | anime({ 48 | targets: Time, 49 | opacity: 1, 50 | easing : 'easeInOutQuart' 51 | }); 52 | })(); 53 | 54 | // feed 55 | (function () { 56 | 57 | // build articles 58 | var articles = document.getElementsByClassName('feed-tile'); 59 | 60 | var goToArticle = function () { 61 | console.warn(this.getAttribute('data-link')); 62 | window.parent.Router.navigate('#!feed'); 63 | }; 64 | 65 | for (var i = 0, len = articles.length; i < len; i++) { 66 | articles[i].addEventListener('click', goToArticle.bind(articles[i])); 67 | 68 | anime({ 69 | targets: articles[i], 70 | opacity: 1, 71 | top : 0, 72 | delay : i * 100, 73 | easing : 'easeInOutQuart' 74 | }); 75 | } 76 | })(); -------------------------------------------------------------------------------- /app/js/index.js: -------------------------------------------------------------------------------- 1 | window.Router = new Navigo(null, true, '#!'); 2 | window.SteemPi = {}; 3 | 4 | // history api 5 | (function () { 6 | var Frame = document.getElementById('module'); 7 | 8 | var openModule = function () { 9 | if (window.location.hash === '') { 10 | Frame.src = '/app/frame.php'; 11 | return; 12 | } 13 | 14 | var hash = window.location.hash.replace('\!', '').replace('\#', ''); 15 | 16 | if (hash === '') { 17 | Frame.src = '/app/frame.php'; 18 | return; 19 | } 20 | 21 | Frame.src = '/modules/' + hash + '/index.php'; 22 | }; 23 | 24 | Router.on('*', openModule); 25 | openModule(); 26 | })(); 27 | 28 | // navigation events 29 | (function () { 30 | var Main = document.querySelector('main'); 31 | var Nav = document.querySelector('nav'); 32 | var HeaderNav = document.querySelector('.header-menu'); 33 | 34 | document.querySelector('.steemPi-logo').addEventListener('mousedown', function (event) { 35 | event.preventDefault(); 36 | }); 37 | 38 | document.querySelector('.steemPi-logo').addEventListener('click', function (event) { 39 | event.preventDefault(); 40 | Router.navigate(''); 41 | }); 42 | 43 | var showMenu = function () { 44 | anime({ 45 | targets : Nav, 46 | left : 0, 47 | easing : 'easeInOutQuart', 48 | duration: 200, 49 | complete: function () { 50 | Nav.classList.add('nav-opened'); 51 | } 52 | }); 53 | }; 54 | 55 | var hideMenu = function () { 56 | Nav.classList.remove('nav-opened'); 57 | 58 | anime({ 59 | targets : Nav, 60 | left : -60, 61 | easing : 'easeInOutQuart', 62 | duration: 500 63 | }); 64 | }; 65 | 66 | var focusNav = function () { 67 | Nav.focus(); 68 | }; 69 | 70 | setTimeout(hideMenu, 2000); 71 | 72 | HeaderNav.tabIndex = -1; 73 | Nav.tabIndex = -1; 74 | 75 | // HeaderNav.addEventListener('focus', focusNav, false); 76 | HeaderNav.addEventListener('click', focusNav, false); 77 | 78 | HeaderNav.addEventListener("touchstart", function (event) { 79 | event.preventDefault(); 80 | focusNav(); 81 | }, false); 82 | 83 | 84 | Nav.addEventListener('focus', showMenu, false); 85 | Nav.addEventListener('blur', hideMenu, false); 86 | 87 | var entries = Nav.querySelectorAll('li a'); 88 | 89 | for (var i = 0, len = entries.length; i < len; i++) { 90 | entries[i].addEventListener('mouseup', hideMenu); 91 | } 92 | })(); -------------------------------------------------------------------------------- /app/js/index.loop.js: -------------------------------------------------------------------------------- 1 | window.SteemPi.moduleLoop = false; 2 | 3 | (function () { 4 | var LoopTimeput = null; 5 | var timer = 10000; 6 | 7 | var Button = document.querySelector('.header-buttons .module-loop'); 8 | var Navigation = document.querySelector('nav .navigation'); 9 | var modules = [].slice.call(Navigation.querySelectorAll('li')); 10 | 11 | modules = modules.map(function (Node) { 12 | return Node.getAttribute('data-module'); 13 | }); 14 | 15 | /** 16 | * Return the next module 17 | * 18 | * @param module 19 | * @return {String} 20 | */ 21 | var getNextModule = function (module) { 22 | var index = modules.indexOf(module); 23 | 24 | if (index === -1) { 25 | return modules[0]; 26 | } 27 | 28 | if (typeof modules[index + 1] !== 'undefined') { 29 | return modules[index + 1]; 30 | } 31 | 32 | return modules[0]; 33 | }; 34 | 35 | /** 36 | * Return the current module 37 | * 38 | * @return {String} 39 | */ 40 | var getCurrent = function () { 41 | var hash = window.location.hash; 42 | 43 | if (hash === '' || hash === '#!') { 44 | return modules[0]; 45 | } 46 | 47 | return hash.replace('#', '').replace('\!', ''); 48 | }; 49 | 50 | /** 51 | * Loops the module 52 | */ 53 | var loop = function () { 54 | if (!window.SteemPi.moduleLoop) { 55 | return; 56 | } 57 | 58 | var PaceNode = document.querySelector('.pace'); 59 | 60 | if (PaceNode) { 61 | var Progress = PaceNode.querySelector('.pace-progress'); 62 | 63 | Progress.style.transform = 'translate3d(0, 0px, 0px)'; 64 | Progress.style.transitionDuration = (timer / 1000) + 's'; 65 | PaceNode.className = 'pace'; 66 | 67 | setTimeout(function () { 68 | Progress.style.transform = 'translate3d(100%, 0px, 0px)'; 69 | }, 10); 70 | 71 | } 72 | 73 | LoopTimeput = setTimeout(function () { 74 | var next = getNextModule(getCurrent()); 75 | 76 | if (PaceNode) { 77 | var Progress = PaceNode.querySelector('.pace-progress'); 78 | 79 | Progress.style.transitionDuration = '0s'; 80 | Progress.style.transform = 'translate3d(0, 0px, 0px)'; 81 | PaceNode.classList.add('pace-inactive'); 82 | } 83 | 84 | Router.navigate(next); 85 | setTimeout(loop, 200); 86 | }, timer); 87 | }; 88 | 89 | // remove events -> workaround 90 | Button.addEventListener('click', function () { 91 | if (window.SteemPi.moduleLoop) { 92 | window.SteemPi.moduleLoop = false; 93 | 94 | if (LoopTimeput) { 95 | clearTimeout(LoopTimeput); 96 | } 97 | 98 | Button.classList.remove('active'); 99 | 100 | var PaceNode = document.querySelector('.pace'); 101 | 102 | if (PaceNode) { 103 | PaceNode.classList.add('pace-inactive'); 104 | } 105 | 106 | return; 107 | } 108 | 109 | Button.classList.add('active'); 110 | window.SteemPi.moduleLoop = true; 111 | 112 | loop(); 113 | }); 114 | })(); -------------------------------------------------------------------------------- /app/locale/de/LC_MESSAGES/steemPi.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/locale/de/LC_MESSAGES/steemPi.po -------------------------------------------------------------------------------- /app/locale/en/LC_MESSAGES/steemPi.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/locale/en/LC_MESSAGES/steemPi.po -------------------------------------------------------------------------------- /app/locale/nl/LC_MESSAGES/steemPi.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/app/locale/nl/LC_MESSAGES/steemPi.po -------------------------------------------------------------------------------- /app/src/SteemPi/Config.php: -------------------------------------------------------------------------------- 1 | file = $file; 43 | $this->config = $Reader->readFile($file); 44 | } 45 | 46 | /** 47 | * Return a init file 48 | * 49 | * @param string $group 50 | * @param string|bool $name - optional 51 | * @return mixed|null 52 | */ 53 | public function get($group, $name = false) 54 | { 55 | if ($name === false) { 56 | if (isset($this->config[$group])) { 57 | return $this->config[$group]; 58 | } 59 | 60 | return null; 61 | } 62 | 63 | if (isset($this->config[$group][$name])) { 64 | return $this->config[$group][$name]; 65 | } 66 | 67 | return null; 68 | } 69 | 70 | /** 71 | * @param string $group - name of the ini group 72 | * @param string|bool $name - optional 73 | * @param string|integer|float $value 74 | */ 75 | public function set($group, $name, $value) 76 | { 77 | if ($name === false) { 78 | $this->config[$group] = $value; 79 | 80 | return; 81 | } 82 | 83 | $this->config[$group][$name] = $value; 84 | } 85 | 86 | /** 87 | * Write the data to the config file 88 | */ 89 | public function save() 90 | { 91 | $Writer = new IniWriter(); 92 | $config = $Writer->writeToString($this->config); 93 | 94 | $result = ';'.PHP_EOL.PHP_EOL; 95 | $result .= $config; 96 | 97 | file_put_contents($this->file, $result); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /app/src/SteemPi/Exception.php: -------------------------------------------------------------------------------- 1 | false, 29 | 'text' => false, 30 | 'color' => false 31 | ); 32 | 33 | /** 34 | * @var array 35 | */ 36 | protected $cssClasses = array(); 37 | 38 | /** 39 | * Menu constructor. 40 | * 41 | * @param array $params 42 | * @param null|Module $Module 43 | */ 44 | public function __construct($params = array(), $Module = null) 45 | { 46 | if (isset($params['icon'])) { 47 | $this->attributes['icon'] = $params['icon']; 48 | } 49 | 50 | if (isset($params['text'])) { 51 | $this->attributes['text'] = $params['text']; 52 | } 53 | 54 | if (isset($params['color'])) { 55 | $this->attributes['color'] = $params['color']; 56 | } 57 | 58 | if ($Module instanceof Module) { 59 | $this->Module = $Module; 60 | } 61 | } 62 | 63 | /** 64 | * @param Module $Module 65 | */ 66 | public function setModule(Module $Module) 67 | { 68 | $this->Module = $Module; 69 | } 70 | 71 | /** 72 | * @param $class 73 | */ 74 | public function addClass($class) 75 | { 76 | $this->cssClasses[] = $class; 77 | } 78 | 79 | /** 80 | * @return string 81 | */ 82 | public function getIcon() 83 | { 84 | if (!isset($this->attributes['icon'])) { 85 | return ''; 86 | } 87 | 88 | $name = htmlspecialchars($this->Module->getName()); 89 | $icon = htmlspecialchars($this->attributes['icon']); 90 | $color = ''; 91 | 92 | if (strpos($icon, 'fa-') === false) { 93 | $path = '/modules/'.$name.'/'.$icon; 94 | $html = ''; 95 | } else { 96 | $html = ''; 97 | } 98 | 99 | if (isset($this->attributes['color'])) { 100 | $color = htmlspecialchars($this->attributes['color']); 101 | } 102 | 103 | return ' 104 | 105 | '.$html.' 106 | 107 | '; 108 | } 109 | 110 | /** 111 | * Return the HTML Title 112 | * 113 | * @return string 114 | */ 115 | public function getText() 116 | { 117 | if (!isset($this->attributes['text'])) { 118 | return ''; 119 | } 120 | 121 | $text = htmlspecialchars($this->attributes['text']); 122 | $text = dgettext($this->Module->getName(), $text); 123 | 124 | return ' 125 | 126 | '.$text.' 127 | 128 | '; 129 | } 130 | 131 | /** 132 | * Return the rendered HTML 133 | * 134 | * @return string 135 | */ 136 | public function create() 137 | { 138 | $icon = $this->getIcon(); 139 | $title = $this->getText(); 140 | 141 | $module = ''; 142 | $classes = ''; 143 | 144 | if ($this->Module) { 145 | $module = $this->Module->getName(); 146 | } 147 | 148 | if (!empty($this->cssClasses)) { 149 | $classes = ' class="'.implode('', $this->cssClasses).'"'; 150 | } 151 | 152 | return ' 153 | '.$icon.' 154 | '.$title.' 155 | '; 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /app/src/SteemPi/Modules/Handler.php: -------------------------------------------------------------------------------- 1 | getModules()); 38 | } 39 | 40 | /** 41 | * Return the module list 42 | * 43 | * @return array 44 | */ 45 | public function getModules() 46 | { 47 | $path = $this->getBaseDir().'modules/'; 48 | $folders = scandir($path); 49 | 50 | $result = array(); 51 | $modules = array(); 52 | 53 | // get the order 54 | $order = SteemPi::getConfig()->get('steempi', 'modulesOrder'); 55 | 56 | if (empty($order)) { 57 | $order = array(); 58 | } else { 59 | $order = explode(',', $order); 60 | } 61 | 62 | // read modules 63 | foreach ($folders as $folder) { 64 | if ($folder == '.' || $folder == '..') { 65 | continue; 66 | } 67 | 68 | if (!file_exists($path.$folder.'/module.json')) { 69 | continue; 70 | } 71 | 72 | $modules[] = new Module($path.$folder.'/module.json'); 73 | } 74 | 75 | // order it 76 | $missingCheck = array(); 77 | 78 | foreach ($order as $moduleName) { 79 | if (file_exists($path.$moduleName.'/module.json')) { 80 | $Module = new Module($path.$moduleName.'/module.json'); 81 | $result[] = $Module; 82 | 83 | $missingCheck[$Module->getName()] = true; 84 | } 85 | } 86 | 87 | /* @var $Module Module */ 88 | foreach ($modules as $Module) { 89 | if (!isset($missingCheck[$Module->getName()])) { 90 | $result[] = $Module; 91 | } 92 | } 93 | 94 | return $result; 95 | } 96 | 97 | /** 98 | * Return a specific module 99 | * 100 | * @param $moduleName 101 | * @return Module 102 | */ 103 | public function getModule($moduleName) 104 | { 105 | $path = $this->getBaseDir().'modules/'; 106 | $Module = new Module($path.$moduleName.'/module.json'); 107 | 108 | return $Module; 109 | } 110 | } -------------------------------------------------------------------------------- /app/src/SteemPi/SteemPi.php: -------------------------------------------------------------------------------- 1 | get('steempi', 'background'); 76 | 77 | if (empty($background)) { 78 | $background = '/app/images/backgrounds/default-06.jpg'; 79 | } 80 | 81 | $realPath = self::getRootPath().$background; 82 | 83 | if (!file_exists($realPath)) { 84 | $background = '/app/images/backgrounds/default-06.jpg'; 85 | } 86 | 87 | return $background; 88 | } 89 | 90 | /** 91 | * Return a list of all available backgrounds 92 | * 93 | * @return array 94 | */ 95 | public static function getBackgrounds() 96 | { 97 | $images = array(); 98 | 99 | // default folder 100 | $dir = self::getRootPath().'/app/images/backgrounds/'; 101 | $handle = opendir($dir); 102 | 103 | while (false !== ($image = readdir($handle))) { 104 | if ($image == '.' || $image == '..') { 105 | continue; 106 | } 107 | 108 | $images[] = '/app/images/backgrounds/'.$image; 109 | } 110 | 111 | // custom folder 112 | $dir = self::getRootPath().'/backgrounds/'; 113 | 114 | if (is_dir($dir)) { 115 | 116 | $handle = opendir($dir); 117 | 118 | while (false !== ($image = readdir($handle))) { 119 | if ($image == '.' || $image == '..') { 120 | continue; 121 | } 122 | 123 | $images[] = '/backgrounds/'.$image; 124 | } 125 | } 126 | 127 | return $images; 128 | } 129 | 130 | /** 131 | * Load the current localization 132 | */ 133 | public static function loadLanguage() 134 | { 135 | $lang = self::getConfig()->get('steempi', 'language'); 136 | 137 | if (!$lang) { 138 | $lang = 'en_GB'; 139 | } 140 | 141 | switch ($lang) { 142 | case 'en_EN': 143 | $lang = 'en_GB'; 144 | break; 145 | } 146 | 147 | setlocale( 148 | 6, 149 | $lang.".UTF-8", 150 | $lang.".utf8", 151 | $lang.".UTF8", 152 | $lang.".utf-8", 153 | $lang 154 | ); 155 | 156 | putenv("LANG=".$lang.'.utf8'); 157 | 158 | bindtextdomain('steemPi', './locale'); 159 | bind_textdomain_codeset('steemPi', 'UTF-8'); 160 | 161 | $modules = self::getModuleHandler()->getModules(); 162 | 163 | /* @var $Module Modules\Module */ 164 | foreach ($modules as $Module) { 165 | $localeDir = $Module->getDir().'locale'; 166 | 167 | if (is_dir($localeDir)) { 168 | bindtextdomain($Module->getName(), $localeDir); 169 | bind_textdomain_codeset($Module->getName(), 'UTF-8'); 170 | } 171 | } 172 | 173 | textdomain('steemPi'); 174 | 175 | \Locale::setDefault(str_replace('_', '-', $lang)); 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /app/tests/gpio.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |
66 | 70 | 71 | 72 | 75 | 76 |
77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /case (3d models)/side panel/giveaway/index.js: -------------------------------------------------------------------------------- 1 | var Form = document.querySelector('Form'); 2 | var Input = document.querySelector('[name="url"]'); 3 | var Result = document.querySelector('.result'); 4 | 5 | var Registrations = document.querySelector('.registrations'); 6 | 7 | /** 8 | * Read the users and generate the list 9 | * 10 | * @param {String} author 11 | * @param {String} permlink 12 | * @return Promise 13 | */ 14 | function generate(author, permlink) { 15 | return new Promise(function (resolve) { 16 | console.log('fetch follower'); 17 | 18 | Promise.all([ 19 | getFollower('dehenne'), 20 | getFollower('techtek') 21 | ]).then(function (result) { 22 | var getUsernames = function (follower) { 23 | return follower.follower; 24 | }; 25 | 26 | var intersect = function (a, b) { 27 | var sorted_a = a.concat().sort(); 28 | var sorted_b = b.concat().sort(); 29 | var common = []; 30 | var a_i = 0; 31 | var b_i = 0; 32 | 33 | while (a_i < a.length && b_i < b.length) { 34 | if (sorted_a[a_i] === sorted_b[b_i]) { 35 | common.push(sorted_a[a_i]); 36 | a_i++; 37 | b_i++; 38 | } else if (sorted_a[a_i] < sorted_b[b_i]) { 39 | a_i++; 40 | } else { 41 | b_i++; 42 | } 43 | } 44 | 45 | return common; 46 | }; 47 | 48 | var dehenne = result[0].map(getUsernames); 49 | var techtek = result[1].map(getUsernames); 50 | 51 | // these are followers which follow dehenne AND techtek 52 | var intersection = intersect(dehenne, techtek); 53 | 54 | console.log('Fetch resteems'); 55 | 56 | getResteemUsers(Input.value).then(function (users) { 57 | console.warn('Resteems: '+ users.length); 58 | 59 | var html = '' 60 | 61 | html = html + '

Registrations

' 62 | html = html + ''; 71 | 72 | Registrations.innerHTML = html; 73 | 74 | resolve(); 75 | }); 76 | }); 77 | }); 78 | } 79 | 80 | /** 81 | * Return the follower of an user 82 | * 83 | * @param {String} username 84 | * @return Promise 85 | */ 86 | function getFollower(username) { 87 | return new Promise(function (resolve) { 88 | steem.api.getFollowers(username, 0, 'blog', 1000, function (err, result) { 89 | resolve(result); 90 | }); 91 | }); 92 | } 93 | 94 | /** 95 | * Return the active votes 96 | * 97 | * @param {String} author 98 | * @param {String} permlink 99 | * @return Promise 100 | */ 101 | function getVotes(author, permlink) { 102 | return new Promise(function (resolve) { 103 | steem.api.getContent(author, permlink, function (err, result) { 104 | resolve(result.active_votes); 105 | }); 106 | }); 107 | } 108 | 109 | 110 | function getResteemUsers(url) { 111 | return new Promise(function(resolve) { 112 | url = url.replace('https://steemit.com', 'https://steemdb.com') +'/reblogs'; 113 | 114 | fetch(url).then(function(Response) { 115 | return Response.text(); 116 | }).then(function(result) { 117 | var Ghost = document.createElement('div'); 118 | Ghost.innerHTML = result; 119 | 120 | var resteemed = Ghost.querySelectorAll('.twelve .relaxed a'); 121 | var result = []; 122 | 123 | for (var i = 0, len = resteemed.length; i < len; i++) { 124 | user = resteemed[i].innerHTML; 125 | user = user.trim(); 126 | user = user.replace('@', ''); 127 | 128 | result.push(user); 129 | } 130 | 131 | resolve(result); 132 | }); 133 | }); 134 | } 135 | 136 | /** 137 | * Return the active votes 138 | * 139 | * @param {String} author 140 | * @param {String} permlink 141 | * @return Promise 142 | */ 143 | //function getResteems(author, permlink) { 144 | // return new Promise(function (resolve) { 145 | // steem.api.getContent(author, permlink, function (err, result) { 146 | // console.warn(result); 147 | // resolve(result.active_votes); 148 | // }); 149 | // }); 150 | //} 151 | 152 | /** 153 | * Formula events 154 | */ 155 | Form.addEventListener('submit', function (event) { 156 | event.preventDefault(); 157 | 158 | var value = Input.value, 159 | Url = new URI(value); 160 | 161 | if (value.indexOf('https://steemit.com') === -1) { 162 | console.error('No Steemit Url'); 163 | return; 164 | } 165 | 166 | var path = Url.path(), 167 | parts = path.split('/'); 168 | 169 | var author = parts[2].replace('@', ''); 170 | var permlink = parts[3]; 171 | 172 | Result.style.display = ''; 173 | 174 | generate(author, permlink).then(function () { 175 | Result.style.display = 'none'; 176 | }); 177 | }); 178 | -------------------------------------------------------------------------------- /case (3d models)/side panel/giveaway/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/case (3d models)/side panel/giveaway/index.png -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "piwik/ini": "1.*", 4 | "guzzlehttp/guzzle": "~6.0", 5 | "wp-cli/php-cli-tools": "*", 6 | "michelf/php-markdown": "1.*" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/favicon.ico -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | &2 15 | exit 1 16 | fi 17 | 18 | ./app/bash/install 19 | -------------------------------------------------------------------------------- /js/index.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | var currentIndex = 0; 3 | 4 | $('.header-buttons .previous,.header-buttons .next').click(function () { 5 | if (this.getAttribute('data-value') === ">") { 6 | currentIndex++; 7 | } else { 8 | currentIndex-- 9 | } 10 | 11 | $('#frame').attr('src', locations[currentIndex]); 12 | }); 13 | 14 | // header 15 | $("#hide").click(function () { 16 | $(".steemit-pond").hide(); 17 | }); 18 | $("#show").click(function () { 19 | $(".steemit-pond").show(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /ledscript/ledscript-orangepi-h3soc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # SteemPi https://steemit.com/@techtek 4 | 5 | # ledscript v1.0 6 | # This script monitors a Steemit account and turns on a LED (gpio17 - wirringpi gpio 0) when change is detected. 7 | # The script uses Streemian.com RSS feed: streemian.com/rss/@techtek/replies as the source for the updates 8 | # To make it monitor replies to your account, change in the first line of the below script "@techtek" to your steemit account. 9 | 10 | 11 | 12 | #Steemit account to monitor, change to your account! 13 | 14 | URL="https://streemian.com/rss/@techtek/replies" 15 | 16 | 17 | 18 | for (( ; ; )); do 19 | mv new.html old.html 2> /dev/null 20 | curl $URL -L --compressed -s > new.html 21 | sleep 1 22 | sed -i 's/[0-9]//g' new.html 23 | sleep 1 24 | DIFF_OUTPUT="$(diff new.html old.html)" 25 | if [ "0" != "${#DIFF_OUTPUT}" ]; then 26 | 27 | 28 | 29 | 30 | # Echo that there is a change detected when comparing old.html with new.html 31 | 32 | echo notification LED On, change detected! 33 | 34 | 35 | 36 | # Make GPIO 1 an output port 37 | 38 | gpio mode 1 out 39 | 40 | 41 | 42 | # Turn the LED ON 43 | 44 | gpio write 1 1 45 | 46 | 47 | sleep 3 48 | 49 | gpio write 1 0 50 | 51 | 52 | sleep 2 53 | 54 | 55 | fi 56 | 57 | done 58 | -------------------------------------------------------------------------------- /ledscript/ledscript.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # SteemPi https://steemit.com/@techtek 4 | 5 | # ledscript v1.0 6 | # This script monitors a Steemit account and turns on a LED (gpio17 - wirringpi gpio 0) when change is detected. 7 | # The script uses Streemian.com RSS feed: streemian.com/rss/@techtek/replies as the source for the updates 8 | # To make it monitor replies to your account, change in the first line of the below script "@techtek" to your steemit account. 9 | 10 | 11 | 12 | #Steemit account to monitor, change to your account! 13 | 14 | URL="https://streemian.com/rss/@techtek/replies" 15 | 16 | 17 | 18 | for (( ; ; )); do 19 | mv new.html old.html 2> /dev/null 20 | curl $URL -L --compressed -s > new.html 21 | sleep 1 22 | sed -i 's/[0-9]//g' new.html 23 | sleep 1 24 | DIFF_OUTPUT="$(diff new.html old.html)" 25 | if [ "0" != "${#DIFF_OUTPUT}" ]; then 26 | 27 | 28 | 29 | 30 | # Echo that there is a change detected when comparing old.html with new.html 31 | 32 | echo notification LED On, change detected! 33 | 34 | 35 | 36 | # Make GPIO 0 an output port 37 | 38 | gpio mode 0 out 39 | 40 | 41 | 42 | # Turn the LED ON 43 | 44 | gpio write 0 1 45 | 46 | 47 | sleep 3 48 | 49 | gpio write 0 0 50 | 51 | 52 | sleep 2 53 | 54 | 55 | fi 56 | 57 | done 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /ledscript/new.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/ledscript/new.html -------------------------------------------------------------------------------- /modules/MontereyBayAquarium/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 35 | 36 | -------------------------------------------------------------------------------- /modules/MontereyBayAquarium/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Monterey Bay Aquarium", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "Monterey Bay Aquarium", 7 | "color": "#BB4632" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/Steemitpond/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | 14 | 16 | 18 | 20 | 21 | -------------------------------------------------------------------------------- /modules/Steemitpond/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/Steemitpond/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Steemit Pond", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "Steemit Pond", 7 | "color": "#3A8199" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/WhaleSonar/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 20 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/WhaleSonar/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/WhaleSonar/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Whale sonar", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "Whale Sonar", 7 | "color": "#9E7682" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/bitcoinexplorer/images/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 19 | 26 | 33 | 40 | 46 | 50 | 54 | 57 | 60 | 61 | BLOCKEXPLORER.COM 62 | 63 | -------------------------------------------------------------------------------- /modules/bitcoinexplorer/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/bitcoinexplorer/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Bitcoin Block Explorer", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "Bitcoin Block Explorer", 7 | "color": "#BB4632" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/discord/images/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 12 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /modules/discord/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 10 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /modules/discord/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 33 | 36 | 37 | -------------------------------------------------------------------------------- /modules/discord/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "SteemPi Chat", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "Chat", 7 | "color": "#BB4632" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/dtube/images/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 13 | 20 | 27 | 34 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /modules/dtube/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 12 | 19 | 25 | 32 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /modules/dtube/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 34 | 35 | -------------------------------------------------------------------------------- /modules/dtube/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "DTube", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "DTube", 7 | "color": "#bd0d13" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/duckduckgo/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/duckduckgo/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "DuckDuckGo", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "DuckDuckGo", 7 | "color": "#BB4632" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/feed/css/feed.css: -------------------------------------------------------------------------------- 1 | 2 | .feed { 3 | padding: 30px 60px 20px 60px; 4 | } 5 | 6 | .feed-tile { 7 | cursor: pointer; 8 | float: left; 9 | opacity: 0; 10 | padding: 0 20px 40px 20px; 11 | position: relative; 12 | top: 20px; 13 | width: calc(100% / 4); 14 | } 15 | 16 | .feed-tile-container { 17 | background-color: #fff; 18 | box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.05); 19 | border: 1px solid #DFDFDF; 20 | height: 400px; 21 | transition: box-shadow .1s ease-out, transform .1s ease-out; 22 | transition-delay: .1s; 23 | overflow: hidden; 24 | border-radius: 4px; 25 | } 26 | 27 | .feed-tile:hover .feed-tile-container { 28 | /*box-shadow: rgba(45, 45, 45, 0.05) 0 2px 2px,*/ 29 | /*rgba(49, 49, 49, 0.05) 0 4px 4px,*/ 30 | /*rgba(42, 42, 42, 0.05) 0 8px 8px,*/ 31 | /*rgba(32, 32, 32, 0.05) 0 16px 16px,*/ 32 | /*rgba(49, 49, 49, 0.05) 0 32px 32px,*/ 33 | /*rgba(35, 35, 35, 0.05) 0 64px 64px;*/ 34 | box-shadow: rgba(32, 32, 32, 0.05) 0 16px 16px; 35 | transform: translate(0, -4px); 36 | } 37 | 38 | .feed-tile-image { 39 | background-color: #EDEDED; 40 | height: 170px; 41 | overflow: hidden; 42 | width: 100%; 43 | } 44 | 45 | .feed-tile-image img { 46 | border: 0; 47 | height: 100%; 48 | object-position: center; 49 | object-fit: cover; 50 | width: 100%; 51 | } 52 | 53 | .feed-tile-info { 54 | height: 175px; 55 | overflow: hidden; 56 | padding: 20px; 57 | } 58 | 59 | .feed-tile-info header { 60 | margin-bottom: 10px; 61 | } 62 | 63 | .feed-tile-action { 64 | border-top: 1px solid #EAF1F6; 65 | color: #8a8a8a; 66 | padding: 20px; 67 | } 68 | 69 | .feed-tile-action-view { 70 | float: right; 71 | } 72 | 73 | /** responsive 74 | ==================================================== */ 75 | 76 | @media (max-width: 1300px) { 77 | .feed-tile { 78 | width: calc(100% / 3); 79 | } 80 | } 81 | 82 | @media (max-width: 1100px) { 83 | .feed-tile { 84 | width: calc(100% / 2); 85 | } 86 | } 87 | 88 | @media (max-width: 700px) { 89 | .feed { 90 | padding: 30px 0 20px 0; 91 | } 92 | 93 | .feed-tile { 94 | width: 100%; 95 | } 96 | } -------------------------------------------------------------------------------- /modules/feed/css/post.css: -------------------------------------------------------------------------------- 1 | article { 2 | background: #fff; 3 | box-shadow: rgba(32, 32, 32, 0.05) 0 2px 20px; 4 | margin-bottom: 2em !important; 5 | margin-top: 2em !important; 6 | padding-bottom: 2em; 7 | padding-top: 2em; 8 | position: relative; 9 | } 10 | 11 | article.loading { 12 | background: transparent; 13 | box-shadow: none; 14 | color: #dedede; 15 | font-size: 3em; 16 | text-align: center; 17 | padding: 2em; 18 | } 19 | 20 | article header h1 { 21 | margin-top: 0; 22 | } 23 | 24 | .fa-close:before { 25 | content: '\00d7'; 26 | } 27 | 28 | .article-close { 29 | font-size: 3em; 30 | cursor: pointer; 31 | height: 1em; 32 | position: absolute; 33 | right: 0; 34 | text-align: center; 35 | top: 0; 36 | width: 1em; 37 | } 38 | 39 | @media (max-width: 900px) { 40 | article { 41 | margin: 0 !important; 42 | padding: 20px !important; 43 | width: 100% !important; 44 | } 45 | 46 | article img { 47 | margin-bottom: 20px; 48 | } 49 | } -------------------------------------------------------------------------------- /modules/feed/css/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | 5 | box-sizing: border-box; 6 | -moz-box-sizing: border-box; 7 | -webkit-box-sizing: border-box; 8 | } 9 | 10 | body { 11 | color: #18191b; 12 | font-family: "Open Sans", sans-serif; 13 | font-weight: 400; 14 | font-size: 15px; 15 | } 16 | -------------------------------------------------------------------------------- /modules/feed/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 12 | 17 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /modules/feed/index.php: -------------------------------------------------------------------------------- 1 | getBody(), true); 11 | $feed = $result['results']; 12 | 13 | ?> 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | STEEMPI | A system for Steemit 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
36 | 43 |
44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /modules/feed/js/feed.js: -------------------------------------------------------------------------------- 1 | var articles = document.getElementsByClassName('feed-tile'); 2 | 3 | /** 4 | * Search the first image of a steemit post 5 | * 6 | * @param {String} body 7 | * @return {String|Boolean} 8 | */ 9 | var getImageUrlFromPost = function (body) { 10 | // markdown 11 | var start = body.indexOf('!['); 12 | 13 | if (start !== -1) { 14 | var startImageUrl = body.indexOf('](', start); 15 | var endImageUrl = body.indexOf(')', start); 16 | 17 | return body.substr( 18 | startImageUrl + 2, 19 | endImageUrl - startImageUrl - 2 20 | ); 21 | } 22 | 23 | // normal images 24 | start = body.indexOf('https://steemitimages.com'); 25 | 26 | if (start !== -1) { 27 | var end = body.substr(start).match(/<| /).index; 28 | 29 | return body.substr( 30 | start, 31 | end 32 | ).trim(); 33 | } 34 | 35 | return false; 36 | }; 37 | 38 | /** 39 | * Load missing article data 40 | * 41 | * @param {HTMLElement} Node 42 | */ 43 | var loadArticleData = function (Node) { 44 | var permlink = Node.getAttribute('data-permlink'); 45 | var author = Node.getAttribute('data-author'); 46 | 47 | if (Node.querySelector('img')) { 48 | return; 49 | } 50 | 51 | steem.api.getContent(author, permlink, function (err, result) { 52 | if (typeof result.body === 'undefined') { 53 | return; 54 | } 55 | 56 | var body = result.body; 57 | var image = getImageUrlFromPost(body); 58 | 59 | if (!image) { 60 | return; 61 | } 62 | 63 | var Image = document.createElement('img'); 64 | Image.src = image; 65 | 66 | var ImageContainer = Node.getElementsByClassName('feed-tile-image')[0]; 67 | ImageContainer.appendChild(Image); 68 | }); 69 | }; 70 | 71 | /** 72 | * Close all articles 73 | * 74 | * @return {Promise} 75 | */ 76 | var closeArticles = function () { 77 | return new Promise(function (resolve) { 78 | for (var i = 0, len = articles.length; i < len; i++) { 79 | anime({ 80 | targets: articles[i], 81 | opacity: 0, 82 | top : -20, 83 | delay : i * 100, 84 | easing : 'easeInOutQuart' 85 | }); 86 | } 87 | 88 | setTimeout(resolve, len * 100); 89 | }); 90 | }; 91 | 92 | /** 93 | * Set click events to the article 94 | * 95 | * @param {HTMLElement} Node 96 | */ 97 | var setArticleEvents = function (Node) { 98 | Node.addEventListener('click', function () { 99 | closeArticles().then(function () { 100 | var permlink = Node.getAttribute('data-permlink'); 101 | var author = Node.getAttribute('data-author'); 102 | 103 | var path = window.location.pathname.replace('index.php', 'post.php'); 104 | 105 | var url = path + '?'; 106 | url += 'permalink=' + permlink; 107 | url += '&author=' + author; 108 | 109 | window.location = url; 110 | }) 111 | }); 112 | }; 113 | 114 | // build articles 115 | for (var i = 0, len = articles.length; i < len; i++) { 116 | loadArticleData(articles[i]); 117 | setArticleEvents(articles[i]); 118 | 119 | anime({ 120 | targets: articles[i], 121 | opacity: 1, 122 | top : 0, 123 | delay : i * 100, 124 | easing : 'easeInOutQuart' 125 | }); 126 | } -------------------------------------------------------------------------------- /modules/feed/js/post.js: -------------------------------------------------------------------------------- 1 | var Article = document.querySelector('article'); 2 | 3 | steem.api.getContent(author, permalink, function (err, result) { 4 | var Data = new FormData(); 5 | Data.append('content', result.body); 6 | 7 | //console.warn(result); 8 | 9 | fetch('/modules/feed/markdown.php', { 10 | method: 'post', 11 | body : Data 12 | }).then(function (response) { 13 | return response.text(); 14 | }).then(function (body) { 15 | Article.classList.remove('loading'); 16 | 17 | var header = '' + 18 | '
' + 19 | '
' + 20 | '

' + result.title + '

' + 21 | '
' + result.created + ' · ' + author + '
' + 22 | '
'; 23 | 24 | Article.style.opacity = 0; 25 | Article.innerHTML = header + body; 26 | 27 | // check headers 28 | var headers = Article.querySelectorAll('h1'); 29 | 30 | for (var i = 0, len = headers.length; i < len; i++) { 31 | if (headers[i].parentNode.nodeName === 'HEADER') { 32 | continue; 33 | } 34 | 35 | if (headers[i].innerHTML === result.title) { 36 | headers[i].parentNode.removeChild(headers[i]); 37 | } 38 | } 39 | 40 | Article.querySelector('.article-close').addEventListener('click', function () { 41 | var Call = anime({ 42 | targets: Article, 43 | opacity: 0, 44 | easing : 'easeInOutQuart' 45 | }); 46 | 47 | Call.complete = function () { 48 | window.location = window.location.pathname.replace('post.php', 'index.php'); 49 | }; 50 | }); 51 | 52 | anime({ 53 | targets: Article, 54 | opacity: 1, 55 | easing : 'easeInOutQuart' 56 | }); 57 | }); 58 | }); -------------------------------------------------------------------------------- /modules/feed/locale/de/LC_MESSAGES/feed.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/modules/feed/locale/de/LC_MESSAGES/feed.mo -------------------------------------------------------------------------------- /modules/feed/locale/de/LC_MESSAGES/feed.po: -------------------------------------------------------------------------------- 1 | 2 | msgid "Feed" 3 | msgstr "Feed" 4 | -------------------------------------------------------------------------------- /modules/feed/locale/en/LC_MESSAGES/feed.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/modules/feed/locale/en/LC_MESSAGES/feed.mo -------------------------------------------------------------------------------- /modules/feed/locale/en/LC_MESSAGES/feed.po: -------------------------------------------------------------------------------- 1 | 2 | msgid "Feed" 3 | msgstr "Feed" 4 | -------------------------------------------------------------------------------- /modules/feed/markdown.php: -------------------------------------------------------------------------------- 1 | ]*)>

#i', 16 | function ($output) { 17 | $result = $output[0]; 18 | $result = str_replace('

', '

', $result); 19 | $result = str_replace('

', '
', $result); 20 | 21 | return $result; 22 | }, 23 | $html 24 | ); 25 | 26 | $html = preg_replace_callback( 27 | '#
]*)>
#i', 28 | function ($output) { 29 | $result = $output[0]; 30 | $result = str_replace('
', '
', $result); 31 | $result = str_replace('
', '', $result); 32 | 33 | return $result; 34 | }, 35 | $html 36 | ); 37 | 38 | $html = str_replace('

', '', $html); 39 | $html = str_replace('

', '', $html); 40 | $html = str_replace('

', '', $html); 41 | $html = str_replace("\n", '', $html); 42 | 43 | // parse empty images 44 | $html = preg_replace_callback( 45 | '/\>(https:\\/\\/.+(\.png|\.jpeg|\.jpg|\.gif|\.bmp))/Ui', 46 | function ($output) { 47 | return '>'; 48 | }, 49 | $html 50 | ); 51 | 52 | echo $html; 53 | exit; 54 | -------------------------------------------------------------------------------- /modules/feed/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Steemit Feed", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "Feed", 7 | "color": "#3498db" 8 | }, 9 | "allowedSettings": [ 10 | "filter-tags", 11 | "filter-usernames" 12 | ], 13 | "settings": [ 14 | { 15 | "type": "text", 16 | "name": "filter-tags", 17 | "text": "Tags (the result is filtered by these tags)" 18 | }, 19 | { 20 | "type": "text", 21 | "name": "filter-usernames", 22 | "text": "Usernames (the result is filtered by these usernames)" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /modules/feed/post.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | STEEMPI | A system for Steemit 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 |
39 | 40 |
41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /modules/feed/utils.php: -------------------------------------------------------------------------------- 1 | getModule('feed'); 10 | 11 | $tags = $Feed->getSetting('feed', 'filter-tags'); 12 | $userNames = $Feed->getSetting('feed', 'filter-usernames'); 13 | $query = array(); 14 | 15 | if (!empty($tags)) { 16 | $tags = preg_replace('/[^A-Za-z0-9\-]/', '', $tags); 17 | $tags = explode(' ', $tags); 18 | 19 | 20 | foreach ($tags as $tag) { 21 | $query[] = 'tags:'.$tag; 22 | } 23 | } 24 | 25 | if (!empty($userNames)) { 26 | $userNames = str_replace('@', '', $userNames); 27 | $userNames = str_replace(',', ' ', $userNames); 28 | $userNames = str_replace(';', ' ', $userNames); 29 | $userNames = preg_replace('/\s+/', ' ', $userNames); 30 | $userNames = explode(' ', $userNames); 31 | 32 | foreach ($userNames as $username) { 33 | $query[] = 'author:'.$username; 34 | } 35 | } 36 | 37 | if (empty($query)) { 38 | $query[] = 'tags:steempi'; 39 | } 40 | 41 | $Client = new GuzzleHttp\Client(); 42 | 43 | return $Client->request('GET', 'https://api.asksteem.com/search', [ 44 | 'query' => [ 45 | 'q' => implode(' ', $query), 46 | 'order' => 'desc', 47 | 'sort_by' => 'created', 48 | 'include' => 'meta', 49 | 'limit' => $limit 50 | ] 51 | ]); 52 | } 53 | 54 | /** 55 | * @param $entry 56 | * @return string 57 | */ 58 | function parseFeedItemToArticle($entry) 59 | { 60 | $description = strip_tags($entry['summary']); 61 | $category = $entry['tags'][0]; 62 | 63 | $entry['pending_payout_value'] = 0; 64 | 65 | if (mb_strlen($description) > 120) { 66 | $description = mb_substr($description, 0, 120).'...'; 67 | } 68 | 69 | $link = 'https://steemit.com/'; 70 | $link .= $category.'/'; 71 | $link .= '@'.$entry['author'].'/'; 72 | $link .= $entry['permlink']; 73 | 74 | $image = ''; 75 | 76 | if (isset($entry['meta']['image'])) { 77 | $image = ''; 78 | } 79 | 80 | $result = ' 81 |
86 |
87 |
'.$image.'
88 | 89 |
90 |
91 |

'.$entry['title'].'

92 |
93 |

'.$description.'

94 |
95 | 96 |
97 | 98 | 99 | '.$entry['pending_payout_value'].' 100 | 101 | 102 | 103 | 104 | '.$entry['net_votes'].' 105 | 106 |
107 |
108 |
'; 109 | 110 | return $result; 111 | } 112 | -------------------------------------------------------------------------------- /modules/issLive/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 34 | 35 | -------------------------------------------------------------------------------- /modules/issLive/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "ISS Live", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "ISS Live", 7 | "color": "#999999" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/openhab/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 30 | 32 | 34 | 36 | 37 | -------------------------------------------------------------------------------- /modules/openhab/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/openhab/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "openHAB", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "openHAB", 7 | "color": "#bd0d13" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/raspberrypiorg/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/raspberrypiorg/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "raspberrypi.org", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "raspberrypi.org", 7 | "color": "#BB4632" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/settings/compile.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | 2 | 3 | 4 | 6 | 7 | 8 | 13 | 19 | 23 | 27 | 28 | 29 | 30 | 37 | 41 | 45 | 52 | 57 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /modules/settings/javascript/settings.js: -------------------------------------------------------------------------------- 1 | var leds = document.querySelectorAll('.led-tests-images img'); 2 | 3 | var click = function (event) { 4 | var Target = event.target; 5 | var led = Target.getAttribute('data-led'); 6 | 7 | var Data = new FormData(); 8 | Data.append('led', led); 9 | 10 | Target.classList.add('on'); 11 | 12 | fetch('/app/tests/ledtest.php', { 13 | method: 'post', 14 | body : Data 15 | }).then(function (response) { 16 | return response.text(); 17 | }).then(function (body) { 18 | Target.classList.remove('on'); 19 | }); 20 | }; 21 | 22 | for (var i = 0, len = leds.length; i < len; i++) { 23 | leds[i].addEventListener('click', click); 24 | } 25 | -------------------------------------------------------------------------------- /modules/settings/locale/de/LC_MESSAGES/settings.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/modules/settings/locale/de/LC_MESSAGES/settings.mo -------------------------------------------------------------------------------- /modules/settings/locale/de/LC_MESSAGES/settings.po: -------------------------------------------------------------------------------- 1 | 2 | msgid "username" 3 | msgstr "Benutzername" 4 | 5 | msgid "language" 6 | msgstr "SteemPi Sprache" 7 | 8 | msgid "settings saved successfully" 9 | msgstr "" 10 | "Die Einstellungen wurden erfolgreich gespeichert.
" 11 | "In wenigen Sekunden wird SteemPi neu geladen." 12 | 13 | msgid "save" 14 | msgstr "Speichern" 15 | 16 | msgid "language en" 17 | msgstr "Englisch (english)" 18 | 19 | msgid "language de" 20 | msgstr "Deutsch" 21 | 22 | msgid "language nl" 23 | msgstr "Niederländisch (nederlands)" 24 | 25 | msgid "main settings" 26 | msgstr "Allgemeine Einstellungen" 27 | 28 | msgid "module activation status" 29 | msgstr "Modul Status" 30 | 31 | msgid "module order" 32 | msgstr "Modul Sortierung" 33 | 34 | msgid "main ledtests" 35 | msgstr "LED Tests" 36 | 37 | msgid "backgrounds" 38 | msgstr "Hintergründe" 39 | 40 | -------------------------------------------------------------------------------- /modules/settings/locale/en/LC_MESSAGES/settings.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/modules/settings/locale/en/LC_MESSAGES/settings.mo -------------------------------------------------------------------------------- /modules/settings/locale/en/LC_MESSAGES/settings.po: -------------------------------------------------------------------------------- 1 | 2 | msgid "username" 3 | msgstr "Username" 4 | 5 | msgid "language" 6 | msgstr "Language" 7 | 8 | msgid "settings saved successfully" 9 | msgstr "" 10 | "Settings saved successfully." 11 | "In a few seconds SteemPi will be reloaded." 12 | 13 | msgid "save" 14 | msgstr "Save" 15 | 16 | msgid "language en" 17 | msgstr "English" 18 | 19 | msgid "language de" 20 | msgstr "German (deutsch)" 21 | 22 | msgid "language nl" 23 | msgstr "Dutch (nederlands)" 24 | 25 | msgid "main settings" 26 | msgstr "General setting" 27 | 28 | msgid "module activation status" 29 | msgstr "Module status" 30 | 31 | msgid "module order" 32 | msgstr "Modul order" 33 | 34 | msgid "main ledtests" 35 | msgstr "LED test" 36 | 37 | msgid "backgrounds" 38 | msgstr "Backgrounds" 39 | 40 | -------------------------------------------------------------------------------- /modules/settings/locale/nl/LC_MESSAGES/settings.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/modules/settings/locale/nl/LC_MESSAGES/settings.mo -------------------------------------------------------------------------------- /modules/settings/locale/nl/LC_MESSAGES/settings.po: -------------------------------------------------------------------------------- 1 | msgid "username" 2 | msgstr "Gebruikersnaam" 3 | 4 | msgid "language" 5 | msgstr "Taal" 6 | 7 | msgid "settings saved successfully" 8 | msgstr "" 9 | "De instellingen zijn succesvol opgeslagen
" 10 | "In enkele ongenblikken zal de SteemPi interface worden geladen" 11 | 12 | msgid "save" 13 | msgstr "Opslaan" 14 | 15 | msgid "language en" 16 | msgstr "Engels (english)" 17 | 18 | msgid "language de" 19 | msgstr "Duits (deutsch)" 20 | 21 | msgid "language nl" 22 | msgstr "Nederlands" 23 | 24 | msgid "main settings" 25 | msgstr "Algemene instellingen" 26 | 27 | msgid "module activation status" 28 | msgstr "Module Status" 29 | 30 | msgid "module order" 31 | msgstr "Module sorteren" 32 | 33 | msgid "main ledtests" 34 | msgstr "LED tests" 35 | 36 | msgid "backgrounds" 37 | msgstr "Achtergronden" 38 | -------------------------------------------------------------------------------- /modules/settings/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "SteemPi Settings", 3 | "topMenu": { 4 | "icon": "fa fa-gears", 5 | "title": "Settings", 6 | "color": "#18191b" 7 | } 8 | } -------------------------------------------------------------------------------- /modules/settings/save.php: -------------------------------------------------------------------------------- 1 | getModules(); 13 | 14 | 15 | unset($_POST['save']); 16 | 17 | /** 18 | * SteemPi main configuration 19 | */ 20 | 21 | // steemit username 22 | $steemitUsername = $_POST['steemitUsername']; 23 | $steemitUsername = str_replace('@', '', $steemitUsername); 24 | $steemitUsername = preg_replace('/[^a-zA-Z0-9\-]/i', '', $steemitUsername); 25 | 26 | if (!empty($steemitUsername)) { 27 | $Config->set('steemit', 'username', $steemitUsername); 28 | } 29 | 30 | // steempi language 31 | $Config->set('steempi', 'language', $_POST['steempiLanguage']); 32 | 33 | // steempi module status 34 | if (isset($_POST['modulesStatus'])) { 35 | $status = $_POST['modulesStatus']; 36 | /* @var $Module \SteemPi\Modules\Module */ 37 | foreach ($modules as $Module) { 38 | if ($Module->getName() === 'settings') { 39 | $Module->activate(); 40 | continue; 41 | } 42 | 43 | if (in_array($Module->getName(), $status)) { 44 | $Module->activate(); 45 | continue; 46 | } 47 | 48 | $Module->deactivate(); 49 | } 50 | } 51 | 52 | // steempi module order 53 | if (isset($_POST['moduleOrder'])) { 54 | asort($_POST['moduleOrder']); 55 | $keys = array_keys($_POST['moduleOrder']); 56 | 57 | $Config->set('steempi', 'modulesOrder', implode(',', $keys)); 58 | 59 | //refresh modules 60 | $modules = $Modules->getModules(); 61 | } 62 | 63 | // backgrounds 64 | if (isset($_POST['background'])) { 65 | $file = SteemPi::getRootPath().$_POST['background']; 66 | 67 | if (file_exists($file)) { 68 | $Config->set('steempi', 'background', $_POST['background']); 69 | } 70 | } 71 | 72 | // save config 73 | $Config->save(); 74 | 75 | SteemPi::loadLanguage(); 76 | 77 | $configSaved = true; 78 | 79 | LEDS::blink(3, 0.5); 80 | 81 | /** 82 | * SteemPi modules configuration 83 | */ 84 | 85 | /* @var $Module \SteemPi\Modules\Module */ 86 | foreach ($modules as $Module) { 87 | $name = $Module->getName(); 88 | 89 | if (!isset($_POST[$name])) { 90 | continue; 91 | } 92 | 93 | if (!is_array($_POST[$name])) { 94 | continue; 95 | } 96 | 97 | foreach ($_POST[$name] as $settingName => $settingValue) { 98 | $Module->setSetting($settingName, $settingValue); 99 | } 100 | 101 | $Module->saveSettings(); 102 | } -------------------------------------------------------------------------------- /modules/spectacles/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 14 | 16 | 18 | 20 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /modules/spectacles/index.php: -------------------------------------------------------------------------------- 1 | get('steemit', 'username'); 9 | 10 | if (!empty($username)) { 11 | $username = '@'.$username; 12 | } 13 | 14 | ?> 15 | 16 | 17 | 18 | STEEMPI | A system for Steemit 19 | 20 | 21 | 22 | 23 | 24 | 25 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /modules/spectacles/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "SPECTACLES", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "SPECTACLES", 7 | "color": "#BB4632" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/stats/css/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | 5 | box-sizing: border-box; 6 | -moz-box-sizing: border-box; 7 | -webkit-box-sizing: border-box; 8 | } 9 | 10 | body { 11 | color: #18191b; 12 | font-family: "Open Sans", sans-serif; 13 | font-weight: 400; 14 | font-size: 15px; 15 | } 16 | 17 | .container { 18 | clear: both; 19 | float: left; 20 | padding: 30px 60px 20px 60px; 21 | width: 100%; 22 | } 23 | 24 | .container header { 25 | background: rgba(255, 255, 255, 0.5); 26 | text-align: center; 27 | font-family: Arial, sans-serif; 28 | font-size: 38px; 29 | margin-top: 40px; 30 | padding-top: 20px; 31 | padding-bottom: 20px; 32 | width: 100%; 33 | } 34 | 35 | .container header h3 { 36 | font-weight: normal; 37 | } 38 | 39 | .container-box { 40 | padding: 10px; 41 | } 42 | 43 | /** Trends 44 | ========================================= */ 45 | 46 | .container-trends { 47 | border-top: none; 48 | } 49 | 50 | .google-trends header { 51 | border-top: none; 52 | } 53 | 54 | .google-trends-box { 55 | float: left; 56 | width: 50%; 57 | } 58 | 59 | .google-trends-box iframe { 60 | background: #ffffff; 61 | border: none; 62 | height: 350px; 63 | width: 100%; 64 | } 65 | 66 | /** Apps 67 | ========================================= */ 68 | 69 | .apps-box { 70 | float: left; 71 | width: 25%; 72 | } 73 | 74 | .apps-box iframe { 75 | height: 125px; 76 | width: 100%; 77 | } 78 | 79 | @media (max-width: 900px) { 80 | .apps-box { 81 | width: 33%; 82 | } 83 | } 84 | 85 | @media (max-width: 768px) { 86 | .apps-box { 87 | width: 50%; 88 | } 89 | } 90 | 91 | @media (max-width: 600px) { 92 | .apps-box { 93 | width: 100%; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /modules/stats/index.php: -------------------------------------------------------------------------------- 1 | get('steemit', 'username'); 13 | 14 | ?> 15 | 16 | 17 | 18 | STEEMPI | A system for Steemit 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 98 | 99 |
100 |
101 |

Coin Stats

102 |
103 | 104 |
105 | 109 |
110 | 111 |
112 | 116 |
117 | 118 |
119 | 123 |
124 | 125 |
126 | 131 |
132 | 133 | -------------------------------------------------------------------------------- /modules/stats/locale/de/LC_MESSAGES/stats.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/modules/stats/locale/de/LC_MESSAGES/stats.mo -------------------------------------------------------------------------------- /modules/stats/locale/de/LC_MESSAGES/stats.po: -------------------------------------------------------------------------------- 1 | 2 | msgid "Stats" 3 | msgstr "Statistiken" 4 | -------------------------------------------------------------------------------- /modules/stats/locale/en/LC_MESSAGES/stats.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techtek/steempi/7ff3f649ed502a23d363ab33ea07c7a9a89c7281/modules/stats/locale/en/LC_MESSAGES/stats.mo -------------------------------------------------------------------------------- /modules/stats/locale/en/LC_MESSAGES/stats.po: -------------------------------------------------------------------------------- 1 | 2 | msgid "Stats" 3 | msgstr "Stats" 4 | -------------------------------------------------------------------------------- /modules/stats/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Stats", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "Stats", 7 | "color": "#e67e22" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/steemstream/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 13 | 18 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /modules/steemstream/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/steemstream/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Steem Stream", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "Steem Stream", 7 | "color": "#BB4632" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/steemsupply/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 12 | 17 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /modules/steemsupply/index.php: -------------------------------------------------------------------------------- 1 | get('steemit', 'username'); 9 | 10 | if (!empty($username)) { 11 | $username = '@'.$username; 12 | } 13 | 14 | ?> 15 | 16 | 17 | 18 | STEEMPI | A system for Steemit 19 | 20 | 21 | 22 | 23 | 24 | 25 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /modules/steemsupply/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Steem Supply", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "Steem Supply", 7 | "color": "#BB4632" 8 | } 9 | } -------------------------------------------------------------------------------- /modules/tedcom/images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /modules/tedcom/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | STEEMPI | A system for Steemit 5 | 6 | 7 | 8 | 9 | 10 | 11 | 30 | 31 | 32 | 34 | 35 | -------------------------------------------------------------------------------- /modules/tedcom/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "TED", 3 | "icon": "images/icon.svg", 4 | "leftMenu": { 5 | "icon": "images/menu.svg", 6 | "text": "TED", 7 | "color": "#E62B1E" 8 | } 9 | } -------------------------------------------------------------------------------- /steempi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | addFlag(array('help', 'h'), 'Show this help screen'); 34 | $Arguments->addFlag(array('version', 'v'), 'Display the version'); 35 | 36 | 37 | $Arguments->addOption( 38 | 'update', 39 | 'Update SteemPi' 40 | ); 41 | 42 | $Arguments->addOption( 43 | 'change-branch', 44 | 'Change between the branches from SteemPi: dev or master' 45 | ); 46 | 47 | 48 | $Arguments->parse(); 49 | $arguments = json_decode($Arguments->asJSON(), true); 50 | 51 | $needHelp = function () use ($arguments) { 52 | if (isset($arguments['help']) && $arguments['help']) { 53 | return true; 54 | } 55 | 56 | foreach ($arguments as $name => $value) { 57 | if ($value === null) { 58 | return false; 59 | } 60 | 61 | if (!empty($value)) { 62 | return false; 63 | } 64 | } 65 | 66 | return true; 67 | }; 68 | 69 | $displayHelp = function () use ($Arguments) { 70 | $logo = " 71 | 72 | Welcome to 73 | 74 | __ _ ___ _ 75 | / _\ |_ ___ ___ _ __ ___ / _ (_) 76 | \ \| __/ _ \/ _ \ '_ ` _ \ / /_)/ | 77 | _\ \ || __/ __/ | | | | / ___/| | 78 | \__/\__\___|\___|_| |_| |_\/ |_| 79 | 80 | "; 81 | 82 | \cli\Colors::enable(); 83 | \cli\line('%C'.$logo.'%n', true); 84 | \cli\Colors::disable(); 85 | 86 | echo PHP_EOL; 87 | echo $Arguments->getHelpScreen(); 88 | echo PHP_EOL.PHP_EOL; 89 | exit; 90 | }; 91 | 92 | 93 | if ($needHelp()) { 94 | $displayHelp(); 95 | } 96 | 97 | if ($arguments['update'] || $arguments['update'] === null) { 98 | include 'app/bash/update.php'; 99 | exit; 100 | } 101 | 102 | if (isset($arguments['change-branch'])) { 103 | system('git fetch'); 104 | switch ($arguments['change-branch']) { 105 | case 'dev': 106 | system('git reset --hard origin/dev'); 107 | exit; 108 | 109 | case 'master': 110 | system('git reset --hard origin/master'); 111 | exit; 112 | 113 | default: 114 | \cli\Colors::enable(); 115 | \cli\line('Please use %C%5dev%n or %C%5master%n as value for --change-branch%n', true); 116 | \cli\Colors::disable(); 117 | exit; 118 | } 119 | } 120 | 121 | $displayHelp(); --------------------------------------------------------------------------------