├── README.md ├── ReadMe.txt ├── assets ├── A-Z.jpg ├── Genre.jpg ├── Movies.jpg ├── Movies.xml ├── Movies │ ├── Actors │ │ ├── actor1.jpg │ │ ├── actor2.jpg │ │ ├── actor3.jpg │ │ └── actor4.jpg │ ├── MoviePlay.xml │ ├── MoviePrePlay.xml │ └── TronLegacy.jpg ├── MoviesA-Z.xml ├── MoviesGenre.xml ├── MoviesGenreGrid.xml ├── MoviesYear.xml ├── TVShows.jpg ├── TVShows.xml ├── TVShows │ ├── BigBang.jpg │ ├── SeasonSelect.xml │ ├── episodePlay.xml │ ├── s01e01.jpg │ ├── s01e02.jpg │ ├── s01e03.jpg │ ├── season1.jpg │ ├── season1episodes.xml │ └── season2.jpg ├── Year.jpg ├── appletv │ ├── application.js │ └── us │ │ └── js │ │ └── application.js ├── index.xml ├── indexold.xml └── media.js ├── atv.js ├── mime.js ├── node_modules ├── .bin │ └── express └── ejs │ ├── .gitmodules │ ├── .npmignore │ ├── History.md │ ├── Makefile │ ├── Readme.md │ ├── benchmark.js │ ├── ejs.js │ ├── ejs.min.js │ ├── examples │ ├── client.html │ ├── list.ejs │ └── list.js │ ├── index.js │ ├── lib │ ├── ejs.js │ ├── filters.js │ └── utils.js │ ├── package.json │ ├── support │ └── compile.js │ └── test │ ├── ejs.test.js │ └── fixtures │ └── user.ejs ├── package.json ├── utils.js └── views ├── error.ejs ├── index.ejs └── layout.ejs /README.md: -------------------------------------------------------------------------------- 1 | ATVBrowser - An ATV2/3 trailer app hack. 2 | 3 | CREDITS:- 4 | I take no credit for writing the DNS Proxy and Web server code, that was written by a guy/gal on the Weiphone BBS by the username of lionphone. I just modified the code to work for me. This is the original forum post:- http://bbs.weiphone.com/read-htm-tid-5128270.html 5 | 6 | DISCLAIMER:- 7 | Standard disclaimer here, by using this code/source package you do so at your own risk. If you lose data, your computer melts, your house blows up or your current planet of residents is destroyed I take no responsibility. Basically don't blame me if anything goes wrong :) 8 | 9 | 10 | INSTRUCTIONS:- 11 | 12 | 1. Download the ATVBrowser zip file. 13 | 14 | 2. Windows:- Unzip the package to any location you like, just keep the directory structure intact. 15 | Mac:- Unzip the package to your Home folder, keep the directory structure intact. 16 | 17 | 3. You need two pieces of information, the IP address of the computer your running the DNS Proxy and Web server on and the DNS address of your ISP. 18 | 19 | 4. Open up the following file /ATVBrowser/atv.js and change the IP address on the second line to the IP address of your computer. 20 | 21 | 5. Open up the following file /ATVBrowser/utils.js and change the IP address on the second line to the IP address of your ISP's DNS. 22 | 23 | 6. You will need any m4v video file that will play on the ATV, it can be a iTunes store purchased file with DRM if you like. 24 | 25 | 7. Rename the video file to test.m4v and copy it into the /ATBrowser/assets directory. 26 | 27 | Now we need to install Node.js 28 | 29 | 1. Goto www.nodejs.org/download 30 | 31 | 2. Windows:- Download the Windows Binary(.exe) 32 or 64 bit version depending on your OS, save the node.exe file into the /ATVBrowser/ Directory. The same location as the atv.js file. VERY IMPORTANT!!! You only need the Windows Binary and not the full installer. 32 | Mac:- Download and install the Mac OSX Installer(.pkg) Universal package. VERY IMPORTANT!!! You need the full installer and not just the binaries. 33 | 34 | Running it all 35 | 36 | Windows:- 37 | 1. Open a command prompt and cd into the ATVBrowser directory. 38 | 2. Type:- node atv.js then press enter. 39 | 3. If all goes well you'll get a message saying the DNS Proxy and Web server are running. 40 | 41 | Mac:- 42 | 1. Open Terminal. The terminal should start up in your home directory. 43 | 2. Type:- cd ATVBrowser followed by enter. 44 | 3. Type:- sudo node atv.js followed by enter. You'll need to enter your user password. VERY IMPORTANT!!! You need to use sudo. 45 | 4. If all goes well you'll get a message saying the DNS Proxy and Web server are running. 46 | 47 | Now goto Setting/General/Network on your ATV and change the DNS address to the IP address of your computer, the one you entered into atv.js. 48 | Browse over to the Trailer app on the ATV and have fun. 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ReadMe.txt: -------------------------------------------------------------------------------- 1 | ATVBrowser - An ATV2/3 trailer app hack. 2 | 3 | CREDITS:- 4 | I take no credit for writing the DNS Proxy and Web server code, that was written by a guy/gal on the Weiphone BBS by the username of lionphone. I just modified the code to work for me. This is the original forum post:- http://bbs.weiphone.com/read-htm-tid-5128270.html 5 | 6 | DISCLAIMER:- 7 | Standard disclaimer here, by using this code/source package you do so at your own risk. If you lose data, your computer melts, your house blows up or your current planet of residents is destroyed I take no responsibility. Basically don't blame me if anything goes wrong :) 8 | 9 | 10 | INSTRUCTIONS:- 11 | 12 | 1. Download the ATVBrowser zip file. 13 | 14 | 2. Windows:- Unzip the package to any location you like, just keep the directory structure intact. 15 | Mac:- Unzip the package to your Home folder, keep the directory structure intact. 16 | 17 | 3. You need two pieces of information, the IP address of the computer your running the DNS Proxy and Web server on and the DNS address of your ISP. 18 | 19 | 4. Open up the following file /ATVBrowser/atv.js and change the IP address on the second line to the IP address of your computer. 20 | 21 | 5. Open up the following file /ATVBrowser/utils.js and change the IP address on the second line to the IP address of your ISP's DNS. 22 | 23 | 6. You will need any m4v video file that will play on the ATV, it can be a iTunes store purchased file with DRM if you like. 24 | 25 | 7. Rename the video file to test.m4v and copy it into the /ATBrowser/assets directory. 26 | 27 | Now we need to install Node.js 28 | 29 | 1. Goto www.nodejs.org/download 30 | 31 | 2. Windows:- Download the Windows Binary(.exe) 32 or 64 bit version depending on your OS, save the node.exe file into the /ATVBrowser/ Directory. The same location as the atv.js file. VERY IMPORTANT!!! You only need the Windows Binary and not the full installer. 32 | Mac:- Download and install the Mac OSX Installer(.pkg) Universal package. VERY IMPORTANT!!! You need the full installer and not just the binaries. 33 | 34 | Running it all 35 | 36 | Windows:- 37 | 1. Open a command prompt and cd into the ATVBrowser directory. 38 | 2. Type:- node atv.js then press enter. 39 | 3. If all goes well you'll get a message saying the DNS Proxy and Web server are running. 40 | 41 | Mac:- 42 | 1. Open Terminal. The terminal should start up in your home directory. 43 | 2. Type:- cd ATVBrowser followed by enter. 44 | 3. Type:- sudo node atv.js followed by enter. You'll need to enter your user password. VERY IMPORTANT!!! You need to use sudo. 45 | 4. If all goes well you'll get a message saying the DNS Proxy and Web server are running. 46 | 47 | Now goto Setting/General/Network on your ATV and change the DNS address to the IP address of your computer, the one you entered into atv.js. 48 | Browse over to the Trailer app on the ATV and have fun. 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /assets/A-Z.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/A-Z.jpg -------------------------------------------------------------------------------- /assets/Genre.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/Genre.jpg -------------------------------------------------------------------------------- /assets/Movies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/Movies.jpg -------------------------------------------------------------------------------- /assets/Movies.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | http://trailers.apple.com/A-Z.jpg 17 | resource://16X9.png 18 | 19 | 20 | 25 | http://trailers.apple.com/Genre.jpg 26 | resource://16X9.png 27 | 28 | 29 | 34 | http://trailers.apple.com/Year.jpg 35 | resource://16X9.png 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | Just Added 44 | 45 | 46 | 47 | 48 | 49 | 50 | 55 | Tron: Legacy 56 | 2010 57 | http://trailers.apple.com/Movies/TronLegacy.jpg 58 | resource://Poster.png 59 | 60 | 65 | Tron: Legacy 66 | 2010 67 | http://trailers.apple.com/Movies/TronLegacy.jpg 68 | resource://Poster.png 69 | 70 | 75 | Tron: Legacy 76 | 2010 77 | http://trailers.apple.com/Movies/TronLegacy.jpg 78 | resource://Poster.png 79 | 80 | 85 | Tron: Legacy 86 | 2010 87 | http://trailers.apple.com/Movies/TronLegacy.jpg 88 | resource://Poster.png 89 | 90 | 95 | Tron: Legacy 96 | 2010 97 | http://trailers.apple.com/Movies/TronLegacy.jpg 98 | resource://Poster.png 99 | 100 | 105 | Tron: Legacy 106 | 2010 107 | http://trailers.apple.com/Movies/TronLegacy.jpg 108 | resource://Poster.png 109 | 110 | 115 | Tron: Legacy 116 | 2010 117 | http://trailers.apple.com/Movies/TronLegacy.jpg 118 | resource://Poster.png 119 | 120 | 125 | Tron: Legacy 126 | 2010 127 | http://trailers.apple.com/Movies/TronLegacy.jpg 128 | resource://Poster.png 129 | 130 | 135 | Tron: Legacy 136 | 2010 137 | http://trailers.apple.com/Movies/TronLegacy.jpg 138 | resource://Poster.png 139 | 140 | 145 | Tron: Legacy 146 | 2010 147 | http://trailers.apple.com/Movies/TronLegacy.jpg 148 | resource://Poster.png 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /assets/Movies/Actors/actor1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/Movies/Actors/actor1.jpg -------------------------------------------------------------------------------- /assets/Movies/Actors/actor2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/Movies/Actors/actor2.jpg -------------------------------------------------------------------------------- /assets/Movies/Actors/actor3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/Movies/Actors/actor3.jpg -------------------------------------------------------------------------------- /assets/Movies/Actors/actor4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/Movies/Actors/actor4.jpg -------------------------------------------------------------------------------- /assets/Movies/MoviePlay.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | http://trailers.apple.com/test.m4v 7 | Tron: Legacy 8 | Sam Flynn, the tech-savvy son of Kevin Flynn, looks into his father's disappearance and finds himself pulled into the same world of fierce programs and gladiatorial games where Kevin has been living for 25 years. Along with Kevin's loyal confidant, father and son embark on a life-and-death journey across a visually-stunning cyber universe that has become far more advanced. 9 | http://trailers.apple.com/Movies/TronLegacy.jpg 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /assets/Movies/MoviePrePlay.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tron: Legacy 6 | Walt Disney Pictures 7 | PG 8 | Sam Flynn, the tech-savvy son of Kevin Flynn, looks into his father's disappearance and finds himself pulled into the same world of fierce programs and gladiatorial games where Kevin has been living for 25 years. Along with Kevin's loyal confidant, father and son embark on a life-and-death journey across a visually-stunning cyber universe that has become far more advanced. 9 | http://trailers.apple.com/Movies/TronLegacy.jpg 10 | resource://Poster.png 11 | 12 | 13 | 14 | 15 | Details 16 | 17 | 18 | Actors 19 | 20 | 21 | Director 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 40 | 41 | 45 | 46 | 47 |
48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Play 56 | resource://Play.png 57 | resource://PlayFocused.png 58 | HD 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Actors 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 82 | Garrett Hedlund 83 | http://trailers.apple.com/Movies/Actors/actor1.jpg 84 | resource://Poster.png 85 | 86 | 87 | 92 | Jeff Bridges 93 | http://trailers.apple.com/Movies/Actors/actor2.jpg 94 | resource://Poster.png 95 | 96 | 97 | 102 | Olivia Wilde 103 | http://trailers.apple.com/Movies/Actors/actor3.jpg 104 | resource://Poster.png 105 | 106 | 107 | 112 | Bruce Boxleitner 113 | http://trailers.apple.com/Movies/Actors/actor4.jpg 114 | resource://Poster.png 115 | 116 | 117 | 118 | 119 | 120 | 121 |
122 | 123 |
-------------------------------------------------------------------------------- /assets/Movies/TronLegacy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/Movies/TronLegacy.jpg -------------------------------------------------------------------------------- /assets/MoviesA-Z.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | Movies A-Z 9 | 10 |
11 | 12 | 13 | 14 | 15 | A 16 | 17 | 18 | 19 | 20 | 21 | 22 | 27 | Tron: Legacy 28 | 2010 29 | http://trailers.apple.com/Movies/TronLegacy.jpg 30 | resource://Poster.png 31 | 32 | 37 | Tron: Legacy 38 | 2010 39 | http://trailers.apple.com/Movies/TronLegacy.jpg 40 | resource://Poster.png 41 | 42 | 47 | Tron: Legacy 48 | 2010 49 | http://trailers.apple.com/Movies/TronLegacy.jpg 50 | resource://Poster.png 51 | 52 | 57 | Tron: Legacy 58 | 2010 59 | http://trailers.apple.com/Movies/TronLegacy.jpg 60 | resource://Poster.png 61 | 62 | 67 | Tron: Legacy 68 | 2010 69 | http://trailers.apple.com/Movies/TronLegacy.jpg 70 | resource://Poster.png 71 | 72 | 77 | Tron: Legacy 78 | 2010 79 | http://trailers.apple.com/Movies/TronLegacy.jpg 80 | resource://Poster.png 81 | 82 | 87 | Tron: Legacy 88 | 2010 89 | http://trailers.apple.com/Movies/TronLegacy.jpg 90 | resource://Poster.png 91 | 92 | 97 | Tron: Legacy 98 | 2010 99 | http://trailers.apple.com/Movies/TronLegacy.jpg 100 | resource://Poster.png 101 | 102 | 107 | Tron: Legacy 108 | 2010 109 | http://trailers.apple.com/Movies/TronLegacy.jpg 110 | resource://Poster.png 111 | 112 | 117 | Tron: Legacy 118 | 2010 119 | http://trailers.apple.com/Movies/TronLegacy.jpg 120 | resource://Poster.png 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | B 129 | 130 | 131 | 132 | 133 | 134 | 135 | 140 | Tron: Legacy 141 | 2010 142 | http://trailers.apple.com/Movies/TronLegacy.jpg 143 | resource://Poster.png 144 | 145 | 150 | Tron: Legacy 151 | 2010 152 | http://trailers.apple.com/Movies/TronLegacy.jpg 153 | resource://Poster.png 154 | 155 | 160 | Tron: Legacy 161 | 2010 162 | http://trailers.apple.com/Movies/TronLegacy.jpg 163 | resource://Poster.png 164 | 165 | 170 | Tron: Legacy 171 | 2010 172 | http://trailers.apple.com/Movies/TronLegacy.jpg 173 | resource://Poster.png 174 | 175 | 180 | Tron: Legacy 181 | 2010 182 | http://trailers.apple.com/Movies/TronLegacy.jpg 183 | resource://Poster.png 184 | 185 | 190 | Tron: Legacy 191 | 2010 192 | http://trailers.apple.com/Movies/TronLegacy.jpg 193 | resource://Poster.png 194 | 195 | 200 | Tron: Legacy 201 | 2010 202 | http://trailers.apple.com/Movies/TronLegacy.jpg 203 | resource://Poster.png 204 | 205 | 210 | Tron: Legacy 211 | 2010 212 | http://trailers.apple.com/Movies/TronLegacy.jpg 213 | resource://Poster.png 214 | 215 | 220 | Tron: Legacy 221 | 2010 222 | http://trailers.apple.com/Movies/TronLegacy.jpg 223 | resource://Poster.png 224 | 225 | 230 | Tron: Legacy 231 | 2010 232 | http://trailers.apple.com/Movies/TronLegacy.jpg 233 | resource://Poster.png 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 |
242 | 243 |
-------------------------------------------------------------------------------- /assets/MoviesGenre.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | Movies by Genre 8 | 9 |
10 | 11 | 12 | 13 | 14 |
15 | 16 | Genres 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | http://trailers.apple.com/MoviesGenreGrid.xml 25 | 26 | 27 | 28 | 29 | 30 | http://trailers.apple.com/MoviesGenreGrid.xml 31 | 32 | 33 | 34 | 35 | 36 | http://trailers.apple.com/MoviesGenreGrid.xml 37 | 38 | 39 | 40 |
41 |
42 |
43 |
44 | 45 |
-------------------------------------------------------------------------------- /assets/MoviesGenreGrid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | Tron: Legacy 14 | 2010 15 | http://trailers.apple.com/Movies/TronLegacy.jpg 16 | resource://Poster.png 17 | 18 | 19 | 23 | Tron: Legacy 24 | 2010 25 | http://trailers.apple.com/Movies/TronLegacy.jpg 26 | resource://Poster.png 27 | 28 | 29 | 33 | Tron: Legacy 34 | 2010 35 | http://trailers.apple.com/Movies/TronLegacy.jpg 36 | resource://Poster.png 37 | 38 | 39 | 43 | Tron: Legacy 44 | 2010 45 | http://trailers.apple.com/Movies/TronLegacy.jpg 46 | resource://Poster.png 47 | 48 | 49 | 53 | Tron: Legacy 54 | 2010 55 | http://trailers.apple.com/Movies/TronLegacy.jpg 56 | resource://Poster.png 57 | 58 | 59 | 63 | Tron: Legacy 64 | 2010 65 | http://trailers.apple.com/Movies/TronLegacy.jpg 66 | resource://Poster.png 67 | 68 | 69 | 73 | Tron: Legacy 74 | 2010 75 | http://trailers.apple.com/Movies/TronLegacy.jpg 76 | resource://Poster.png 77 | 78 | 79 | 83 | Tron: Legacy 84 | 2010 85 | http://trailers.apple.com/Movies/TronLegacy.jpg 86 | resource://Poster.png 87 | 88 | 89 | 93 | Tron: Legacy 94 | 2010 95 | http://trailers.apple.com/Movies/TronLegacy.jpg 96 | resource://Poster.png 97 | 98 | 99 | 103 | Tron: Legacy 104 | 2010 105 | http://trailers.apple.com/Movies/TronLegacy.jpg 106 | resource://Poster.png 107 | 108 | 109 | 113 | Tron: Legacy 114 | 2010 115 | http://trailers.apple.com/Movies/TronLegacy.jpg 116 | resource://Poster.png 117 | 118 | 119 | 123 | Tron: Legacy 124 | 2010 125 | http://trailers.apple.com/Movies/TronLegacy.jpg 126 | resource://Poster.png 127 | 128 | 129 | 133 | Tron: Legacy 134 | 2010 135 | http://trailers.apple.com/Movies/TronLegacy.jpg 136 | resource://Poster.png 137 | 138 | 139 | 143 | Tron: Legacy 144 | 2010 145 | http://trailers.apple.com/Movies/TronLegacy.jpg 146 | resource://Poster.png 147 | 148 | 149 | 153 | Tron: Legacy 154 | 2010 155 | http://trailers.apple.com/Movies/TronLegacy.jpg 156 | resource://Poster.png 157 | 158 | 159 | 163 | Tron: Legacy 164 | 2010 165 | http://trailers.apple.com/Movies/TronLegacy.jpg 166 | resource://Poster.png 167 | 168 | 169 | 173 | Tron: Legacy 174 | 2010 175 | http://trailers.apple.com/Movies/TronLegacy.jpg 176 | resource://Poster.png 177 | 178 | 179 | 183 | Tron: Legacy 184 | 2010 185 | http://trailers.apple.com/Movies/TronLegacy.jpg 186 | resource://Poster.png 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | -------------------------------------------------------------------------------- /assets/MoviesYear.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | Movies by Year 9 | 10 |
11 | 12 | 13 | 14 | 15 | 2010 16 | 17 | 18 | 19 | 20 | 21 | 22 | 27 | Tron: Legacy 28 | 2010 29 | http://trailers.apple.com/Movies/TronLegacy.jpg 30 | resource://Poster.png 31 | 32 | 37 | Tron: Legacy 38 | 2010 39 | http://trailers.apple.com/Movies/TronLegacy.jpg 40 | resource://Poster.png 41 | 42 | 47 | Tron: Legacy 48 | 2010 49 | http://trailers.apple.com/Movies/TronLegacy.jpg 50 | resource://Poster.png 51 | 52 | 57 | Tron: Legacy 58 | 2010 59 | http://trailers.apple.com/Movies/TronLegacy.jpg 60 | resource://Poster.png 61 | 62 | 67 | Tron: Legacy 68 | 2010 69 | http://trailers.apple.com/Movies/TronLegacy.jpg 70 | resource://Poster.png 71 | 72 | 77 | Tron: Legacy 78 | 2010 79 | http://trailers.apple.com/Movies/TronLegacy.jpg 80 | resource://Poster.png 81 | 82 | 87 | Tron: Legacy 88 | 2010 89 | http://trailers.apple.com/Movies/TronLegacy.jpg 90 | resource://Poster.png 91 | 92 | 97 | Tron: Legacy 98 | 2010 99 | http://trailers.apple.com/Movies/TronLegacy.jpg 100 | resource://Poster.png 101 | 102 | 107 | Tron: Legacy 108 | 2010 109 | http://trailers.apple.com/Movies/TronLegacy.jpg 110 | resource://Poster.png 111 | 112 | 117 | Tron: Legacy 118 | 2010 119 | http://trailers.apple.com/Movies/TronLegacy.jpg 120 | resource://Poster.png 121 | 122 | 123 | 124 | 125 | 126 | 127 |
128 | 129 |
-------------------------------------------------------------------------------- /assets/TVShows.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/TVShows.jpg -------------------------------------------------------------------------------- /assets/TVShows.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | The Big Bang Theory 17 | 3 Episodes 18 | http://trailers.apple.com/TVShows/BigBang.jpg 19 | resource://Poster.png 20 | 21 | 26 | The Big Bang Theory 27 | 3 Episodes 28 | http://trailers.apple.com/TVShows/BigBang.jpg 29 | resource://Poster.png 30 | 31 | 36 | The Big Bang Theory 37 | 3 Episodes 38 | http://trailers.apple.com/TVShows/BigBang.jpg 39 | resource://Poster.png 40 | 41 | 46 | The Big Bang Theory 47 | 3 Episodes 48 | http://trailers.apple.com/TVShows/BigBang.jpg 49 | resource://Poster.png 50 | 51 | 56 | The Big Bang Theory 57 | 3 Episodes 58 | http://trailers.apple.com/TVShows/BigBang.jpg 59 | resource://Poster.png 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /assets/TVShows/BigBang.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/TVShows/BigBang.jpg -------------------------------------------------------------------------------- /assets/TVShows/SeasonSelect.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | The Big Bang Theory 8 | 9 |
10 | 11 | 12 | http://trailers.apple.com/trailers/independent/thehost/images/poster-xlarge.jpg 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | http://trailers.apple.com/TVShows/season1.jpg 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | http://trailers.apple.com/TVShows/season2.jpg 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 | 41 |
42 | -------------------------------------------------------------------------------- /assets/TVShows/episodePlay.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | http://trailers.apple.com/test.m4v 7 | The Big Bang Theory 8 | Episode description goes here. 9 | http://trailers.apple.com/TVShows/BigBang.jpg 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /assets/TVShows/s01e01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/TVShows/s01e01.jpg -------------------------------------------------------------------------------- /assets/TVShows/s01e02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/TVShows/s01e02.jpg -------------------------------------------------------------------------------- /assets/TVShows/s01e03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/TVShows/s01e03.jpg -------------------------------------------------------------------------------- /assets/TVShows/season1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/TVShows/season1.jpg -------------------------------------------------------------------------------- /assets/TVShows/season1episodes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | The Big Bang Theory 8 | Season 1 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | HD 21 | 1 22 | 2 23 | http://trailers.apple.com/TVShows/s01e01.jpg 24 | resource://16x9.png 25 | 26 | 27 | Pilot 28 | Brilliant physicist roommates Leonard and Sheldon meet their new neighbor Penny, who begins showing them that as much as they know about science, they know little about actual living. 29 | http://trailers.apple.com/TVShows/s01e01.jpg 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | HD 45 | 2 46 | 2 47 | http://trailers.apple.com/TVShows/s01e02.jpg 48 | resource://16x9.png 49 | 50 | 51 | The Big Bran Hypothesis 52 | Leonard volunteers to sign for a package in an attempt to make a good impression on Penny, but when he enlists Sheldon for help, his attempt at chivalry goes terribly awry. 53 | http://trailers.apple.com/TVShows/s01e02.jpg 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 67 | 68 | HD 69 | 3 70 | 2 71 | http://trailers.apple.com/TVShows/s01e03.jpg 72 | resource://16x9.png 73 | 74 | 75 | The Fuzzy Boots Corollary 76 | Leonard asks a woman out after he finds out that Penny is seeing someone. 77 | http://trailers.apple.com/TVShows/s01e03.jpg 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 |
92 | 93 |
94 | -------------------------------------------------------------------------------- /assets/TVShows/season2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/TVShows/season2.jpg -------------------------------------------------------------------------------- /assets/Year.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/finkdiff/ATVBrowser-script/02779a532c8642a0dbf6d1c86ce1a2c1ea020a42/assets/Year.jpg -------------------------------------------------------------------------------- /assets/appletv/application.js: -------------------------------------------------------------------------------- 1 | atv.config = { 2 | "doesJavaScriptLoadRoot": true, 3 | "DEBUG_LEVEL": 4, 4 | "ROOT_URL": "http://trailers.apple.com/appletv/index.xml" 5 | }; 6 | 7 | atv.onAppEntry = function() 8 | { 9 | atv.loadURL('http://trailers.apple.com/index.xml'); 10 | } 11 | -------------------------------------------------------------------------------- /assets/appletv/us/js/application.js: -------------------------------------------------------------------------------- 1 | atv.config = { 2 | "doesJavaScriptLoadRoot": true, 3 | "DEBUG_LEVEL": 4, 4 | "ROOT_URL": "http://trailers.apple.com/appletv/index.xml" 5 | }; 6 | 7 | atv.onAppEntry = function() 8 | { 9 | atv.loadURL('http://trailers.apple.com/index.xml'); 10 | } 11 | -------------------------------------------------------------------------------- /assets/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | http://trailers.apple.com/Movies.jpg 17 | resource://16X9.png 18 | 19 | 20 | 25 | http://trailers.apple.com/TVShows.jpg 26 | resource://16X9.png 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /assets/indexold.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4 | 13 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /node_modules/ejs/examples/list.ejs: -------------------------------------------------------------------------------- 1 | <% if (names.length) { %> 2 | 7 | <% } %> -------------------------------------------------------------------------------- /node_modules/ejs/examples/list.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var ejs = require('../') 7 | , fs = require('fs') 8 | , str = fs.readFileSync(__dirname + '/list.ejs', 'utf8'); 9 | 10 | var ret = ejs.render(str, { 11 | names: ['foo', 'bar', 'baz'] 12 | }); 13 | 14 | console.log(ret); -------------------------------------------------------------------------------- /node_modules/ejs/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/ejs'); -------------------------------------------------------------------------------- /node_modules/ejs/lib/ejs.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * EJS 4 | * Copyright(c) 2012 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var utils = require('./utils') 13 | , fs = require('fs'); 14 | 15 | /** 16 | * Library version. 17 | */ 18 | 19 | exports.version = '0.7.2'; 20 | 21 | /** 22 | * Filters. 23 | * 24 | * @type Object 25 | */ 26 | 27 | var filters = exports.filters = require('./filters'); 28 | 29 | /** 30 | * Intermediate js cache. 31 | * 32 | * @type Object 33 | */ 34 | 35 | var cache = {}; 36 | 37 | /** 38 | * Clear intermediate js cache. 39 | * 40 | * @api public 41 | */ 42 | 43 | exports.clearCache = function(){ 44 | cache = {}; 45 | }; 46 | 47 | /** 48 | * Translate filtered code into function calls. 49 | * 50 | * @param {String} js 51 | * @return {String} 52 | * @api private 53 | */ 54 | 55 | function filtered(js) { 56 | return js.substr(1).split('|').reduce(function(js, filter){ 57 | var parts = filter.split(':') 58 | , name = parts.shift() 59 | , args = parts.shift() || ''; 60 | if (args) args = ', ' + args; 61 | return 'filters.' + name + '(' + js + args + ')'; 62 | }); 63 | }; 64 | 65 | /** 66 | * Re-throw the given `err` in context to the 67 | * `str` of ejs, `filename`, and `lineno`. 68 | * 69 | * @param {Error} err 70 | * @param {String} str 71 | * @param {String} filename 72 | * @param {String} lineno 73 | * @api private 74 | */ 75 | 76 | function rethrow(err, str, filename, lineno){ 77 | var lines = str.split('\n') 78 | , start = Math.max(lineno - 3, 0) 79 | , end = Math.min(lines.length, lineno + 3); 80 | 81 | // Error context 82 | var context = lines.slice(start, end).map(function(line, i){ 83 | var curr = i + start + 1; 84 | return (curr == lineno ? ' >> ' : ' ') 85 | + curr 86 | + '| ' 87 | + line; 88 | }).join('\n'); 89 | 90 | // Alter exception message 91 | err.path = filename; 92 | err.message = (filename || 'ejs') + ':' 93 | + lineno + '\n' 94 | + context + '\n\n' 95 | + err.message; 96 | 97 | throw err; 98 | } 99 | 100 | /** 101 | * Parse the given `str` of ejs, returning the function body. 102 | * 103 | * @param {String} str 104 | * @return {String} 105 | * @api public 106 | */ 107 | 108 | var parse = exports.parse = function(str, options){ 109 | var options = options || {} 110 | , open = options.open || exports.open || '<%' 111 | , close = options.close || exports.close || '%>'; 112 | 113 | var buf = [ 114 | "var buf = [];" 115 | , "\nwith (locals) {" 116 | , "\n buf.push('" 117 | ]; 118 | 119 | var lineno = 1; 120 | 121 | var consumeEOL = false; 122 | for (var i = 0, len = str.length; i < len; ++i) { 123 | if (str.slice(i, open.length + i) == open) { 124 | i += open.length 125 | 126 | var prefix, postfix, line = '__stack.lineno=' + lineno; 127 | switch (str.substr(i, 1)) { 128 | case '=': 129 | prefix = "', escape((" + line + ', '; 130 | postfix = ")), '"; 131 | ++i; 132 | break; 133 | case '-': 134 | prefix = "', (" + line + ', '; 135 | postfix = "), '"; 136 | ++i; 137 | break; 138 | default: 139 | prefix = "');" + line + ';'; 140 | postfix = "; buf.push('"; 141 | } 142 | 143 | var end = str.indexOf(close, i) 144 | , js = str.substring(i, end) 145 | , start = i 146 | , n = 0; 147 | 148 | if ('-' == js[js.length-1]){ 149 | js = js.substring(0, js.length - 2); 150 | consumeEOL = true; 151 | } 152 | 153 | while (~(n = js.indexOf("\n", n))) n++, lineno++; 154 | if (js.substr(0, 1) == ':') js = filtered(js); 155 | buf.push(prefix, js, postfix); 156 | i += end - start + close.length - 1; 157 | 158 | } else if (str.substr(i, 1) == "\\") { 159 | buf.push("\\\\"); 160 | } else if (str.substr(i, 1) == "'") { 161 | buf.push("\\'"); 162 | } else if (str.substr(i, 1) == "\r") { 163 | buf.push(" "); 164 | } else if (str.substr(i, 1) == "\n") { 165 | if (consumeEOL) { 166 | consumeEOL = false; 167 | } else { 168 | buf.push("\\n"); 169 | lineno++; 170 | } 171 | } else { 172 | buf.push(str.substr(i, 1)); 173 | } 174 | } 175 | 176 | buf.push("');\n}\nreturn buf.join('');"); 177 | return buf.join(''); 178 | }; 179 | 180 | /** 181 | * Compile the given `str` of ejs into a `Function`. 182 | * 183 | * @param {String} str 184 | * @param {Object} options 185 | * @return {Function} 186 | * @api public 187 | */ 188 | 189 | var compile = exports.compile = function(str, options){ 190 | options = options || {}; 191 | 192 | var input = JSON.stringify(str) 193 | , filename = options.filename 194 | ? JSON.stringify(options.filename) 195 | : 'undefined'; 196 | 197 | // Adds the fancy stack trace meta info 198 | str = [ 199 | 'var __stack = { lineno: 1, input: ' + input + ', filename: ' + filename + ' };', 200 | rethrow.toString(), 201 | 'try {', 202 | exports.parse(str, options), 203 | '} catch (err) {', 204 | ' rethrow(err, __stack.input, __stack.filename, __stack.lineno);', 205 | '}' 206 | ].join("\n"); 207 | 208 | if (options.debug) console.log(str); 209 | var fn = new Function('locals, filters, escape', str); 210 | return function(locals){ 211 | return fn.call(this, locals, filters, utils.escape); 212 | } 213 | }; 214 | 215 | /** 216 | * Render the given `str` of ejs. 217 | * 218 | * Options: 219 | * 220 | * - `locals` Local variables object 221 | * - `cache` Compiled functions are cached, requires `filename` 222 | * - `filename` Used by `cache` to key caches 223 | * - `scope` Function execution context 224 | * - `debug` Output generated function body 225 | * - `open` Open tag, defaulting to "<%" 226 | * - `close` Closing tag, defaulting to "%>" 227 | * 228 | * @param {String} str 229 | * @param {Object} options 230 | * @return {String} 231 | * @api public 232 | */ 233 | 234 | exports.render = function(str, options){ 235 | var fn 236 | , options = options || {}; 237 | 238 | if (options.cache) { 239 | if (options.filename) { 240 | fn = cache[options.filename] || (cache[options.filename] = compile(str, options)); 241 | } else { 242 | throw new Error('"cache" option requires "filename".'); 243 | } 244 | } else { 245 | fn = compile(str, options); 246 | } 247 | 248 | options.__proto__ = options.locals; 249 | return fn.call(options.scope, options); 250 | }; 251 | 252 | /** 253 | * Render an EJS file at the given `path` and callback `fn(err, str)`. 254 | * 255 | * @param {String} path 256 | * @param {Object|Function} options or callback 257 | * @param {Function} fn 258 | * @api public 259 | */ 260 | 261 | exports.renderFile = function(path, options, fn){ 262 | var key = path + ':string'; 263 | 264 | if ('function' == typeof options) { 265 | fn = options, options = {}; 266 | } 267 | 268 | options.filename = path; 269 | 270 | try { 271 | var str = options.cache 272 | ? cache[key] || (cache[key] = fs.readFileSync(path, 'utf8')) 273 | : fs.readFileSync(path, 'utf8'); 274 | 275 | fn(null, exports.render(str, options)); 276 | } catch (err) { 277 | fn(err); 278 | } 279 | }; 280 | 281 | // express support 282 | 283 | exports.__express = exports.renderFile; 284 | 285 | /** 286 | * Expose to require(). 287 | */ 288 | 289 | if (require.extensions) { 290 | require.extensions['.ejs'] = function(module, filename) { 291 | source = require('fs').readFileSync(filename, 'utf-8'); 292 | module._compile(compile(source, {}), filename); 293 | }; 294 | } else if (require.registerExtension) { 295 | require.registerExtension('.ejs', function(src) { 296 | return compile(src, {}); 297 | }); 298 | } 299 | -------------------------------------------------------------------------------- /node_modules/ejs/lib/filters.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * EJS - Filters 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * First element of the target `obj`. 10 | */ 11 | 12 | exports.first = function(obj) { 13 | return obj[0]; 14 | }; 15 | 16 | /** 17 | * Last element of the target `obj`. 18 | */ 19 | 20 | exports.last = function(obj) { 21 | return obj[obj.length - 1]; 22 | }; 23 | 24 | /** 25 | * Capitalize the first letter of the target `str`. 26 | */ 27 | 28 | exports.capitalize = function(str){ 29 | str = String(str); 30 | return str[0].toUpperCase() + str.substr(1, str.length); 31 | }; 32 | 33 | /** 34 | * Downcase the target `str`. 35 | */ 36 | 37 | exports.downcase = function(str){ 38 | return String(str).toLowerCase(); 39 | }; 40 | 41 | /** 42 | * Uppercase the target `str`. 43 | */ 44 | 45 | exports.upcase = function(str){ 46 | return String(str).toUpperCase(); 47 | }; 48 | 49 | /** 50 | * Sort the target `obj`. 51 | */ 52 | 53 | exports.sort = function(obj){ 54 | return Object.create(obj).sort(); 55 | }; 56 | 57 | /** 58 | * Sort the target `obj` by the given `prop` ascending. 59 | */ 60 | 61 | exports.sort_by = function(obj, prop){ 62 | return Object.create(obj).sort(function(a, b){ 63 | a = a[prop], b = b[prop]; 64 | if (a > b) return 1; 65 | if (a < b) return -1; 66 | return 0; 67 | }); 68 | }; 69 | 70 | /** 71 | * Size or length of the target `obj`. 72 | */ 73 | 74 | exports.size = exports.length = function(obj) { 75 | return obj.length; 76 | }; 77 | 78 | /** 79 | * Add `a` and `b`. 80 | */ 81 | 82 | exports.plus = function(a, b){ 83 | return Number(a) + Number(b); 84 | }; 85 | 86 | /** 87 | * Subtract `b` from `a`. 88 | */ 89 | 90 | exports.minus = function(a, b){ 91 | return Number(a) - Number(b); 92 | }; 93 | 94 | /** 95 | * Multiply `a` by `b`. 96 | */ 97 | 98 | exports.times = function(a, b){ 99 | return Number(a) * Number(b); 100 | }; 101 | 102 | /** 103 | * Divide `a` by `b`. 104 | */ 105 | 106 | exports.divided_by = function(a, b){ 107 | return Number(a) / Number(b); 108 | }; 109 | 110 | /** 111 | * Join `obj` with the given `str`. 112 | */ 113 | 114 | exports.join = function(obj, str){ 115 | return obj.join(str || ', '); 116 | }; 117 | 118 | /** 119 | * Truncate `str` to `len`. 120 | */ 121 | 122 | exports.truncate = function(str, len){ 123 | str = String(str); 124 | return str.substr(0, len); 125 | }; 126 | 127 | /** 128 | * Truncate `str` to `n` words. 129 | */ 130 | 131 | exports.truncate_words = function(str, n){ 132 | var str = String(str) 133 | , words = str.split(/ +/); 134 | return words.slice(0, n).join(' '); 135 | }; 136 | 137 | /** 138 | * Replace `pattern` with `substitution` in `str`. 139 | */ 140 | 141 | exports.replace = function(str, pattern, substitution){ 142 | return String(str).replace(pattern, substitution || ''); 143 | }; 144 | 145 | /** 146 | * Prepend `val` to `obj`. 147 | */ 148 | 149 | exports.prepend = function(obj, val){ 150 | return Array.isArray(obj) 151 | ? [val].concat(obj) 152 | : val + obj; 153 | }; 154 | 155 | /** 156 | * Append `val` to `obj`. 157 | */ 158 | 159 | exports.append = function(obj, val){ 160 | return Array.isArray(obj) 161 | ? obj.concat(val) 162 | : obj + val; 163 | }; 164 | 165 | /** 166 | * Map the given `prop`. 167 | */ 168 | 169 | exports.map = function(arr, prop){ 170 | return arr.map(function(obj){ 171 | return obj[prop]; 172 | }); 173 | }; 174 | 175 | /** 176 | * Reverse the given `obj`. 177 | */ 178 | 179 | exports.reverse = function(obj){ 180 | return Array.isArray(obj) 181 | ? obj.reverse() 182 | : String(obj).split('').reverse().join(''); 183 | }; 184 | 185 | /** 186 | * Get `prop` of the given `obj`. 187 | */ 188 | 189 | exports.get = function(obj, prop){ 190 | return obj[prop]; 191 | }; 192 | 193 | /** 194 | * Packs the given `obj` into json string 195 | */ 196 | exports.json = function(obj){ 197 | return JSON.stringify(obj); 198 | }; -------------------------------------------------------------------------------- /node_modules/ejs/lib/utils.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * EJS 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Escape the given string of `html`. 10 | * 11 | * @param {String} html 12 | * @return {String} 13 | * @api private 14 | */ 15 | 16 | exports.escape = function(html){ 17 | return String(html) 18 | .replace(/&(?!\w+;)/g, '&') 19 | .replace(//g, '>') 21 | .replace(/"/g, '"'); 22 | }; 23 | -------------------------------------------------------------------------------- /node_modules/ejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ejs", 3 | "description": "Embedded JavaScript templates", 4 | "version": "0.7.2", 5 | "author": { 6 | "name": "TJ Holowaychuk", 7 | "email": "tj@vision-media.ca" 8 | }, 9 | "keywords": [ 10 | "template", 11 | "engine", 12 | "ejs" 13 | ], 14 | "devDependencies": { 15 | "mocha": "*" 16 | }, 17 | "main": "./lib/ejs.js", 18 | "repository": { 19 | "type": "git", 20 | "url": "git://github.com/visionmedia/ejs.git" 21 | }, 22 | "readme": "\n# EJS\n\nEmbedded JavaScript templates.\n\n## Installation\n\n $ npm install ejs\n\n## Features\n\n * Complies with the [Express](http://expressjs.com) view system\n * Static caching of intermediate JavaScript\n * Unbuffered code for conditionals etc `<% code %>`\n * Escapes html by default with `<%= code %>`\n * Unescaped buffering with `<%- code %>`\n * Supports tag customization\n * Filter support for designer-friendly templates\n * Client-side support\n * Newline slurping with `<% code -%>` or `<% -%>` or `<%= code -%>` or `<%- code -%>`\n\n## Example\n\n <% if (user) { %>\n\t

<%= user.name %>

\n <% } %>\n\n## Usage\n\n ejs.compile(str, options);\n // => Function\n\n ejs.render(str, options);\n // => str\n\n## Options\n\n - `cache` Compiled functions are cached, requires `filename`\n - `filename` Used by `cache` to key caches\n - `scope` Function execution context\n - `debug` Output generated function body\n - `open` Open tag, defaulting to \"<%\"\n - `close` Closing tag, defaulting to \"%>\"\n - * All others are template-local variables\n\n## Custom tags\n\nCustom tags can also be applied globally:\n\n var ejs = require('ejs');\n ejs.open = '{{';\n ejs.close = '}}';\n\nWhich would make the following a valid template:\n\n

{{= title }}

\n\n## Filters\n\nEJS conditionally supports the concept of \"filters\". A \"filter chain\"\nis a designer friendly api for manipulating data, without writing JavaScript.\n\nFilters can be applied by supplying the _:_ modifier, so for example if we wish to take the array `[{ name: 'tj' }, { name: 'mape' }, { name: 'guillermo' }]` and output a list of names we can do this simply with filters:\n\nTemplate:\n\n

<%=: users | map:'name' | join %>

\n\nOutput:\n\n

Tj, Mape, Guillermo

\n\nRender call:\n\n ejs.render(str, {\n users: [\n { name: 'tj' },\n { name: 'mape' },\n { name: 'guillermo' }\n ]\n });\n\nOr perhaps capitalize the first user's name for display:\n\n

<%=: users | first | capitalize %>

\n\n## Filter list\n\nCurrently these filters are available:\n\n - first\n - last\n - capitalize\n - downcase\n - upcase\n - sort\n - sort_by:'prop'\n - size\n - length\n - plus:n\n - minus:n\n - times:n\n - divided_by:n\n - join:'val'\n - truncate:n\n - truncate_words:n\n - replace:pattern,substitution\n - prepend:val\n - append:val\n - map:'prop'\n - reverse\n - get:'prop'\n\n## Adding filters\n\n To add a filter simply add a method to the `.filters` object:\n \n```js\nejs.filters.last = function(obj) {\n return obj[obj.length - 1];\n};\n```\n\n## client-side support\n\n include `./ejs.js` or `./ejs.min.js` and `require(\"ejs\").compile(str)`.\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2009-2010 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 23 | "readmeFilename": "Readme.md", 24 | "_id": "ejs@0.7.2", 25 | "dist": { 26 | "shasum": "8032ee9f1fccdae8376582fee1c6d80b31aa1bd3" 27 | }, 28 | "_from": "ejs@0.7.2", 29 | "_resolved": "https://registry.npmjs.org/ejs/-/ejs-0.7.2.tgz" 30 | } 31 | -------------------------------------------------------------------------------- /node_modules/ejs/support/compile.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var fs = require('fs'); 7 | 8 | /** 9 | * Arguments. 10 | */ 11 | 12 | var args = process.argv.slice(2) 13 | , pending = args.length 14 | , files = {}; 15 | 16 | console.log(''); 17 | 18 | // parse arguments 19 | 20 | args.forEach(function(file){ 21 | var mod = file.replace('lib/', ''); 22 | fs.readFile(file, 'utf8', function(err, js){ 23 | if (err) throw err; 24 | console.log(' \033[90mcompile : \033[0m\033[36m%s\033[0m', file); 25 | files[file] = parse(js); 26 | --pending || compile(); 27 | }); 28 | }); 29 | 30 | /** 31 | * Parse the given `js`. 32 | */ 33 | 34 | function parse(js) { 35 | return parseInheritance(parseConditionals(js)); 36 | } 37 | 38 | /** 39 | * Parse __proto__. 40 | */ 41 | 42 | function parseInheritance(js) { 43 | return js 44 | .replace(/^ *(\w+)\.prototype\.__proto__ * = *(\w+)\.prototype *;?/gm, function(_, child, parent){ 45 | return child + '.prototype = new ' + parent + ';\n' 46 | + child + '.prototype.constructor = '+ child + ';\n'; 47 | }); 48 | } 49 | 50 | /** 51 | * Parse the given `js`, currently supporting: 52 | * 53 | * 'if' ['node' | 'browser'] 54 | * 'end' 55 | * 56 | */ 57 | 58 | function parseConditionals(js) { 59 | var lines = js.split('\n') 60 | , len = lines.length 61 | , buffer = true 62 | , browser = false 63 | , buf = [] 64 | , line 65 | , cond; 66 | 67 | for (var i = 0; i < len; ++i) { 68 | line = lines[i]; 69 | if (/^ *\/\/ *if *(node|browser)/gm.exec(line)) { 70 | cond = RegExp.$1; 71 | buffer = browser = 'browser' == cond; 72 | } else if (/^ *\/\/ *end/.test(line)) { 73 | buffer = true; 74 | browser = false; 75 | } else if (browser) { 76 | buf.push(line.replace(/^( *)\/\//, '$1')); 77 | } else if (buffer) { 78 | buf.push(line); 79 | } 80 | } 81 | 82 | return buf.join('\n'); 83 | } 84 | 85 | /** 86 | * Compile the files. 87 | */ 88 | 89 | function compile() { 90 | var buf = ''; 91 | buf += '\n// CommonJS require()\n\n'; 92 | buf += browser.require + '\n\n'; 93 | buf += 'require.modules = {};\n\n'; 94 | buf += 'require.resolve = ' + browser.resolve + ';\n\n'; 95 | buf += 'require.register = ' + browser.register + ';\n\n'; 96 | buf += 'require.relative = ' + browser.relative + ';\n\n'; 97 | args.forEach(function(file){ 98 | var js = files[file]; 99 | file = file.replace('lib/', ''); 100 | buf += '\nrequire.register("' + file + '", function(module, exports, require){\n'; 101 | buf += js; 102 | buf += '\n}); // module: ' + file + '\n'; 103 | }); 104 | fs.writeFile('ejs.js', buf, function(err){ 105 | if (err) throw err; 106 | console.log(' \033[90m create : \033[0m\033[36m%s\033[0m', 'ejs.js'); 107 | console.log(); 108 | }); 109 | } 110 | 111 | // refactored version of weepy's 112 | // https://github.com/weepy/brequire/blob/master/browser/brequire.js 113 | 114 | var browser = { 115 | 116 | /** 117 | * Require a module. 118 | */ 119 | 120 | require: function require(p){ 121 | if ('fs' == p) return {}; 122 | var path = require.resolve(p) 123 | , mod = require.modules[path]; 124 | if (!mod) throw new Error('failed to require "' + p + '"'); 125 | if (!mod.exports) { 126 | mod.exports = {}; 127 | mod.call(mod.exports, mod, mod.exports, require.relative(path)); 128 | } 129 | return mod.exports; 130 | }, 131 | 132 | /** 133 | * Resolve module path. 134 | */ 135 | 136 | resolve: function(path){ 137 | var orig = path 138 | , reg = path + '.js' 139 | , index = path + '/index.js'; 140 | return require.modules[reg] && reg 141 | || require.modules[index] && index 142 | || orig; 143 | }, 144 | 145 | /** 146 | * Return relative require(). 147 | */ 148 | 149 | relative: function(parent) { 150 | return function(p){ 151 | if ('.' != p.substr(0, 1)) return require(p); 152 | 153 | var path = parent.split('/') 154 | , segs = p.split('/'); 155 | path.pop(); 156 | 157 | for (var i = 0; i < segs.length; i++) { 158 | var seg = segs[i]; 159 | if ('..' == seg) path.pop(); 160 | else if ('.' != seg) path.push(seg); 161 | } 162 | 163 | return require(path.join('/')); 164 | }; 165 | }, 166 | 167 | /** 168 | * Register a module. 169 | */ 170 | 171 | register: function(path, fn){ 172 | require.modules[path] = fn; 173 | } 174 | }; -------------------------------------------------------------------------------- /node_modules/ejs/test/ejs.test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var ejs = require('../') 6 | , assert = require('assert'); 7 | 8 | module.exports = { 9 | 'test .version': function(){ 10 | assert.ok(/^\d+\.\d+\.\d+$/.test(ejs.version), 'Test .version format'); 11 | }, 12 | 13 | 'test html': function(){ 14 | assert.equal('

yay

', ejs.render('

yay

')); 15 | }, 16 | 17 | 'test renderFile': function(){ 18 | var html = '

tj

', 19 | str = '

<%= name %>

', 20 | options = { name: 'tj', open: '{', close: '}' }; 21 | 22 | ejs.renderFile(__dirname + '/fixtures/user.ejs', options, function(err, res){ 23 | assert.ok(!err); 24 | assert.equal(res, html); 25 | }) 26 | }, 27 | 28 | 'test buffered code': function(){ 29 | var html = '

tj

', 30 | str = '

<%= name %>

', 31 | locals = { name: 'tj' }; 32 | assert.equal(html, ejs.render(str, { locals: locals })); 33 | }, 34 | 35 | 'test unbuffered code': function(){ 36 | var html = '

tj

', 37 | str = '<% if (name) { %>

<%= name %>

<% } %>', 38 | locals = { name: 'tj' }; 39 | assert.equal(html, ejs.render(str, { locals: locals })); 40 | }, 41 | 42 | 'test `scope` option': function(){ 43 | var html = '

tj

', 44 | str = '

<%= this %>

'; 45 | assert.equal(html, ejs.render(str, { scope: 'tj' })); 46 | }, 47 | 48 | 'test escaping': function(){ 49 | assert.equal('<script>', ejs.render('<%= "