1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 2018/5/7
- * Time: 下午9:16
- */
- define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
- require_once(BASE_ROOT_PATH . '/fooder.php');
- require_once(BASE_ROOT_PATH . '/helper/statistics/stlog.php');
- class TestLog extends PHPUnit_Framework_TestCase
- {
- public static function setUpBeforeClass()
- {
- Base::run_util();
- }
- public function testPairlog()
- {
- $checker = new scope_trace(__METHOD__);
- $input = '0';
- $ret = empty($input);
- if('0' === false) {
- $ret = 10;
- }
- }
- public function testLoc()
- {
- $path = '/Users/stanley-king/tmp/20180506.log';
- $stlog = new statistics\stlog($path);
- $stlog->daily();
- }
- public function testStart()
- {
- $line = '[28785 2018-05-06 00:08:47] DEBUG: content=act=login&op=status';
- $command = '/\[(\d*)\s+(.*)\]\s+DEBUG:\s+(.*)/ui';
- $val = preg_match_all($command,$line,$match);
- $trdid = intval($match[1][0]);
- $stime = strtotime($match[2][0]);
- $content = $match[3][0];
- }
- public function testUrl()
- {
- $json = '{
- "tag": "classesInSession",
- "success": 1,
- "error": 0,
- "class_counts": 80,
- "classes": [{
- "class_id": 139,
- "seesion_id": 7,
- "title": "\u7b2c1\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u8fdb\u5165\u5f53\u4e0b",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/1.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "13:36",
- "play_times": 8156
- }, {
- "class_id": 140,
- "seesion_id": 7,
- "title": "\u7b2c2\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6709\u610f\u8bc6\u7684\u653e\u677e",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/2.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "13:20",
- "play_times": 5330
- }, {
- "class_id": 141,
- "seesion_id": 7,
- "title": "\u7b2c3\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u56de\u5230\u4f60\u7684\u4e94\u611f",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/3.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "11:12",
- "play_times": 3661
- }, {
- "class_id": 142,
- "seesion_id": 7,
- "title": "\u7b2c4\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u53cb\u5584\u7684\u6001\u5ea6",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/4.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "13:37",
- "play_times": 4227
- }, {
- "class_id": 143,
- "seesion_id": 7,
- "title": "\u7b2c5\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6b63\u5ff5\u547c\u5438",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/5.mp3",
- "created_at": "2017-03-23 13:58:06",
- "updated_at": "2017-03-23 13:58:06",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "09:44",
- "play_times": 1651
- }, {
- "class_id": 424,
- "seesion_id": 7,
- "title": "\u7b2c6\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u4f34\u968f\u547c\u5438\u7684\u5e73\u9759\u548c\u7a33\u5b9a",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/6.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 2021
- }, {
- "class_id": 425,
- "seesion_id": 7,
- "title": "\u7b2c7\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6570\u547c\u5438",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/7.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1631
- }, {
- "class_id": 426,
- "seesion_id": 7,
- "title": "\u7b2c8\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u6df1\u5165\u4e13\u6ce8\u529b",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/8.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1927
- }, {
- "class_id": 427,
- "seesion_id": 7,
- "title": "\u7b2c9\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u8eab\u4f53\u7684\u6b63\u5ff5",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/9.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1773
- }, {
- "class_id": 428,
- "seesion_id": 7,
- "title": "\u7b2c10\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u7531\u5185\u800c\u5916\u7684\u611f\u53d7",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/10.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1633
- }, {
- "class_id": 429,
- "seesion_id": 7,
- "title": "\u7b2c11\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u8eab\u4f53\u626b\u63cf",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/11.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1739
- }, {
- "class_id": 430,
- "seesion_id": 7,
- "title": "\u7b2c12\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u547d\u540d\u611f\u53d7",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/12.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1395
- }, {
- "class_id": 431,
- "seesion_id": 7,
- "title": "\u7b2c13\u5929 - \u6b63\u5ff5\u57fa\u7840 | \u5e94\u5bf9\u5f3a\u70c8\u7684\u611f\u53d7",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/13.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1568
- }, {
- "class_id": 432,
- "seesion_id": 7,
- "title": "\u7b2c14\u5929 - \u60c5\u5546 | \u6b63\u5ff5\u548c\u60c5\u7eea",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/14.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1549
- }, {
- "class_id": 433,
- "seesion_id": 7,
- "title": "\u7b2c15\u5929 - \u60c5\u5546 | \u547d\u540d\u60c5\u7eea\t",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/15.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 939
- }, {
- "class_id": 434,
- "seesion_id": 7,
- "title": "\u7b2c16\u5929 - \u60c5\u5546 | \u5e94\u5bf9\u56f0\u96be\u60c5\u7eea",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/16.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1466
- }, {
- "class_id": 435,
- "seesion_id": 7,
- "title": "\u7b2c17\u5929 - \u60c5\u5546 | \u57f9\u517b\u79ef\u6781\u60c5\u7eea",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/17.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1490
- }, {
- "class_id": 436,
- "seesion_id": 7,
- "title": "\u7b2c18\u5929 - \u60c5\u5546 | \u8ba4\u51fa\u5ff5\u5934\u7684\u4e0d\u65ad\u4ea7\u751f",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/18.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1286
- }, {
- "class_id": 437,
- "seesion_id": 7,
- "title": "\u7b2c19\u5929 - \u60c5\u5546 | \u548c\u5ff5\u5934\u7684\u667a\u6167\u5173\u7cfb",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/19.mp3",
- "created_at": "2017-03-23 18:03:13",
- "updated_at": "2017-03-23 18:03:13",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1326
- }, {
- "class_id": 438,
- "seesion_id": 7,
- "title": "\u7b2c20\u5929 - \u60c5\u5546 | \u5ff5\u5934\u4e0b\u7684\u751f\u6d3b",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/20.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1171
- }, {
- "class_id": 439,
- "seesion_id": 7,
- "title": "\u7b2c21\u5929 - \u60c5\u5546 | \u8d85\u8d8a\u5ff5\u5934",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/21.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1135
- }, {
- "class_id": 440,
- "seesion_id": 7,
- "title": "\u7b2c22\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/22.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1809
- }, {
- "class_id": 441,
- "seesion_id": 7,
- "title": "\u7b2c23\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u81ea\u6211\u8bc4\u5224\u548c\u81ea\u6211\u5173\u6000",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/23.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1276
- }, {
- "class_id": 442,
- "seesion_id": 7,
- "title": "\u7b2c24\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | RAIN",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/24.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1004
- }, {
- "class_id": 443,
- "seesion_id": 7,
- "title": "\u7b2c25\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u60c5\u7eea\u548c\u5185\u5728\u8d44\u6e90",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/25.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 1002
- }, {
- "class_id": 444,
- "seesion_id": 7,
- "title": "\u7b2c26\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u521d\u5b66\u8005\u7684\u5fc3",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/26.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 827
- }, {
- "class_id": 445,
- "seesion_id": 7,
- "title": "\u7b2c27\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u65e0\u8fb9\u65e0\u9645\u7684\u89c9\u77e5",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/27.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 932
- }, {
- "class_id": 446,
- "seesion_id": 7,
- "title": "\u7b2c28\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u5e73\u7b49\u5fc3",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/28.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 769
- }, {
- "class_id": 447,
- "seesion_id": 7,
- "title": "\u7b2c29\u5929 - \u97e7\u6027\uff0c\u7597\u6108\u548c\u5185\u5728\u7684\u81ea\u7531 | \u5bf9\u89c9\u77e5\u7684\u6b63\u5ff5",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/29.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 769
- }, {
- "class_id": 448,
- "seesion_id": 7,
- "title": "\u7b2c30\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u540c\u7406\u5fc3\u548c\u6148\u60b2\u5fc3",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/30.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 882
- }, {
- "class_id": 449,
- "seesion_id": 7,
- "title": "\u7b2c31\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u5bbd\u6055",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/31.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 809
- }, {
- "class_id": 450,
- "seesion_id": 7,
- "title": "\u7b2c32\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u770b\u89c1\u5584\u6027",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/32.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 749
- }, {
- "class_id": 451,
- "seesion_id": 7,
- "title": "\u7b2c33\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u610f\u56fe",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/33.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 690
- }, {
- "class_id": 452,
- "seesion_id": 7,
- "title": "\u7b2c34\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u51b2\u7a81",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/34.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 680
- }, {
- "class_id": 453,
- "seesion_id": 7,
- "title": "\u7b2c35\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u503e\u542c",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/35.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 671
- }, {
- "class_id": 454,
- "seesion_id": 7,
- "title": "\u7b2c36\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u6b63\u5ff5\u7684\u8bf4",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/36.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 695
- }, {
- "class_id": 455,
- "seesion_id": 7,
- "title": "\u7b2c37\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u4fe1\u4efb\u548c\u5b58\u5728\u4e8e\u4f60\u7684\u5b58\u5728",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/37.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 771
- }, {
- "class_id": 456,
- "seesion_id": 7,
- "title": "\u7b2c38\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u6177\u6168\u548c\u670d\u52a1",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/38.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 577
- }, {
- "class_id": 457,
- "seesion_id": 7,
- "title": "\u7b2c39\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u57f9\u80b2\u611f\u6069\u7684\u5fc3",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/39.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 631
- }, {
- "class_id": 458,
- "seesion_id": 7,
- "title": "\u7b2c40\u5929 - \u6b63\u5ff5\u751f\u6d3b | \u671f\u8bb8\u548c\u613f\u666f",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/40.mp3",
- "created_at": "2017-03-23 18:03:14",
- "updated_at": "2017-03-23 18:03:14",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 643
- }, {
- "class_id": 459,
- "seesion_id": 7,
- "title": "1 Arriving in Presence",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/1e.mp3",
- "created_at": "2017-03-23 20:04:29",
- "updated_at": "2017-03-23 20:04:29",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 381
- }, {
- "class_id": 460,
- "seesion_id": 7,
- "title": "2 Conscious Relaxing",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/2e.mp3",
- "created_at": "2017-03-23 20:04:29",
- "updated_at": "2017-03-23 20:04:29",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 193
- }, {
- "class_id": 493,
- "seesion_id": 7,
- "title": "3 Coming Back to your Senses",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/3e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 181
- }, {
- "class_id": 494,
- "seesion_id": 7,
- "title": "4 Attitude of Friendliness",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/4e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 160
- }, {
- "class_id": 495,
- "seesion_id": 7,
- "title": "5 Mindfulness of Breath",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/5e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 155
- }, {
- "class_id": 496,
- "seesion_id": 7,
- "title": "6 Calming and Steadying with the Breath",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/6e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 163
- }, {
- "class_id": 497,
- "seesion_id": 7,
- "title": "7 Counting the Breath",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/7e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 136
- }, {
- "class_id": 498,
- "seesion_id": 7,
- "title": "8 Deepening the Focus",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/8e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 143
- }, {
- "class_id": 499,
- "seesion_id": 7,
- "title": "9 Mindfulness of the Body",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/9e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 135
- }, {
- "class_id": 500,
- "seesion_id": 7,
- "title": "10 Feeling from the Inside Out",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/10e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 138
- }, {
- "class_id": 501,
- "seesion_id": 7,
- "title": "11 Body Scan",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/11e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 129
- }, {
- "class_id": 502,
- "seesion_id": 7,
- "title": "12 Naming Sensations",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/12e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 129
- }, {
- "class_id": 503,
- "seesion_id": 7,
- "title": "13 Working with Intense Sensations",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/13e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 130
- }, {
- "class_id": 504,
- "seesion_id": 7,
- "title": "14 Mindfulness and Emotions",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/14e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 120
- }, {
- "class_id": 505,
- "seesion_id": 7,
- "title": "15 Naming Emotions",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/15e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 121
- }, {
- "class_id": 506,
- "seesion_id": 7,
- "title": "16 Working with Difficult Emotions",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/16e.mp3",
- "created_at": "2017-03-23 20:27:41",
- "updated_at": "2017-03-23 20:27:41",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 120
- }, {
- "class_id": 507,
- "seesion_id": 7,
- "title": "17 Fostering Positive Emotions",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/17e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 117
- }, {
- "class_id": 508,
- "seesion_id": 7,
- "title": "18 Recognizing Thinking",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/18e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 123
- }, {
- "class_id": 509,
- "seesion_id": 7,
- "title": "19 Wise Relationship to Thoughts",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/19e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 114
- }, {
- "class_id": 510,
- "seesion_id": 7,
- "title": "20 Life Under Thoughts",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/20e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 117
- }, {
- "class_id": 511,
- "seesion_id": 7,
- "title": "21 Beyond Thoughts",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/21e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 117
- }, {
- "class_id": 512,
- "seesion_id": 7,
- "title": "22 Mindfulness: The Core Practice",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/22e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 124
- }, {
- "class_id": 513,
- "seesion_id": 7,
- "title": "23 Self-judgement and Self-Compassion",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/23e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 118
- }, {
- "class_id": 514,
- "seesion_id": 7,
- "title": "24 RAIN",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/24e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 117
- }, {
- "class_id": 515,
- "seesion_id": 7,
- "title": "25 Emotions and Inner Resources",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/25e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 113
- }, {
- "class_id": 516,
- "seesion_id": 7,
- "title": "26 Beginner\'s Mind",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/26e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 116
- }, {
- "class_id": 517,
- "seesion_id": 7,
- "title": "27 Spacious Awareness",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/27e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 120
- }, {
- "class_id": 518,
- "seesion_id": 7,
- "title": "28 Equanimity",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/28e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 115
- }, {
- "class_id": 519,
- "seesion_id": 7,
- "title": "29 Who am I?(Mindfulness of Awareness)",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/29e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 116
- }, {
- "class_id": 520,
- "seesion_id": 7,
- "title": "30 Empathy and Compassion",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/30e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 111
- }, {
- "class_id": 521,
- "seesion_id": 7,
- "title": "31 Forgiveness",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/31e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 108
- }, {
- "class_id": 522,
- "seesion_id": 7,
- "title": "32 Seeing Goodness",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/32e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 110
- }, {
- "class_id": 523,
- "seesion_id": 7,
- "title": "33 Intention",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/33e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 116
- }, {
- "class_id": 524,
- "seesion_id": 7,
- "title": "34 Conflict",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/34e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 113
- }, {
- "class_id": 525,
- "seesion_id": 7,
- "title": "35 Listening",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/35e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 119
- }, {
- "class_id": 526,
- "seesion_id": 7,
- "title": "36 Mindful Speaking",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/36e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 115
- }, {
- "class_id": 527,
- "seesion_id": 7,
- "title": "37 Trusting and Inhabiting your Being",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/37e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 122
- }, {
- "class_id": 528,
- "seesion_id": 7,
- "title": "38 Generosity and Service",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/38e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 116
- }, {
- "class_id": 529,
- "seesion_id": 7,
- "title": "39 Nourishing a Grateful Heart",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/39e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 122
- }, {
- "class_id": 530,
- "seesion_id": 7,
- "title": "40 Aspiration and Vision",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/md\/40e.mp3",
- "created_at": "2017-03-23 20:27:42",
- "updated_at": "2017-03-23 20:27:42",
- "author_name": "\u777f\u5fc3\u7075\u7280",
- "duration": "10:00",
- "play_times": 125
- }]
- }';
- $y = '{
- "tag": "classesInSession",
- "success": 1,
- "error": 0,
- "class_counts": 24,
- "classes": [{
- "class_id": 13,
- "seesion_id": 3,
- "title": "1-1 \u5230\u8fbe\u6211\u4eec\u6240\u5728\u4e4b\u5904 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/1-1 \u5230\u8fbe\u6211\u4eec\u6240\u5728\u4e4b\u5904 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-09-27 18:47:55",
- "updated_at": "2016-09-27 18:47:55",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "08:36",
- "play_times": 19569
- }, {
- "class_id": 14,
- "seesion_id": 3,
- "title": "1-2 \u6b63\u5ff5\u547c\u5438 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/1-2 \u6b63\u5ff5\u547c\u5438 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "07:31",
- "play_times": 10634
- }, {
- "class_id": 16,
- "seesion_id": 3,
- "title": "2-1 \u4e0e\u6211\u4eec\u7684\u8eab\u4f53\u8054\u63a5 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/2-1 \u4e0e\u6211\u4eec\u7684\u8eab\u4f53\u8054\u63a5 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "07:38",
- "play_times": 7747
- }, {
- "class_id": 17,
- "seesion_id": 3,
- "title": "2-2 \u8bc6\u522b\u611f\u5b98\u611f\u53d7 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/2-2 \u8bc6\u522b\u611f\u5b98\u611f\u53d7 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "07:01",
- "play_times": 5223
- }, {
- "class_id": 18,
- "seesion_id": 3,
- "title": "3-1 20\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-1 20\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 10:48:22",
- "updated_at": "2016-10-24 10:48:22",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "20:46",
- "play_times": 12187
- }, {
- "class_id": 19,
- "seesion_id": 3,
- "title": "3-2 30\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-2 30\u5206\u949f\u6b63\u5ff5\u6838\u5fc3\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 10:48:24",
- "updated_at": "2016-10-24 10:48:24",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "31:31",
- "play_times": 8758
- }, {
- "class_id": 20,
- "seesion_id": 3,
- "title": "3-3 \u60c5\u611f\u7684\u89c9\u77e5 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-3 \u60c5\u611f\u7684\u89c9\u77e5 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "10:23",
- "play_times": 4588
- }, {
- "class_id": 21,
- "seesion_id": 3,
- "title": "3-4 \u60c5\u611f\u7684\u6b63\u5ff5 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/3-4 \u60c5\u611f\u7684\u6b63\u5ff5 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "12:01",
- "play_times": 3687
- }, {
- "class_id": 22,
- "seesion_id": 3,
- "title": "4-1 \u5bf9\u4e8e\u60f3\u6cd5\u7684\u6b63\u5ff5 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/4-1 \u5bf9\u4e8e\u60f3\u6cd5\u7684\u6b63\u5ff5 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "03:11",
- "play_times": 3602
- }, {
- "class_id": 23,
- "seesion_id": 3,
- "title": "4-2 \u601d\u7ef4\u7684\u4ea7\u751f - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/4-2 \u601d\u7ef4\u7684\u4ea7\u751f - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "05:12",
- "play_times": 3156
- }, {
- "class_id": 24,
- "seesion_id": 3,
- "title": "4-3 \u4e86\u89e3\u4fe1\u5ff5 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/4-3 \u4e86\u89e3\u4fe1\u5ff5 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-09-27 18:52:54",
- "updated_at": "2016-09-27 18:52:54",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "03:30",
- "play_times": 2522
- }, {
- "class_id": 25,
- "seesion_id": 3,
- "title": "5-1 R.A.I.N\u51a5\u60f3 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/5-1 R.A.I.N\u51a5\u60f3 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "08:30",
- "play_times": 3371
- }, {
- "class_id": 26,
- "seesion_id": 3,
- "title": "5-2 \u6269\u5c55\u5bf9\u81ea\u6211\u6148\u60b2\u7684\u80fd\u529b - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/5-2 \u6269\u5c55\u5bf9\u81ea\u6211\u6148\u60b2\u7684\u80fd\u529b - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "13:06",
- "play_times": 4046
- }, {
- "class_id": 27,
- "seesion_id": 3,
- "title": "6-1 \u63d0\u4f9b\u8d44\u6e90 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/6-1 \u63d0\u4f9b\u8d44\u6e90 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "06:54",
- "play_times": 2228
- }, {
- "class_id": 28,
- "seesion_id": 3,
- "title": "7-1 \u6148\u7231\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/7-1 \u6148\u7231\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "09:41",
- "play_times": 2931
- }, {
- "class_id": 29,
- "seesion_id": 3,
- "title": "7-2 \u5bbd\u6055\u7ec3\u4e60 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/7-2 \u5bbd\u6055\u7ec3\u4e60 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "10:54",
- "play_times": 2665
- }, {
- "class_id": 30,
- "seesion_id": 3,
- "title": "8-1 \u5bf9\u4ed6\u4eba\u7684\u6148\u5fc3\u7ec3\u4e60 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/8-1 \u5bf9\u4ed6\u4eba\u7684\u6148\u5fc3\u7ec3\u4e60 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "18:12",
- "play_times": 2374
- }, {
- "class_id": 31,
- "seesion_id": 3,
- "title": "8-2 \u6269\u5c55\u6148\u60b2\u5fc3\u7684\u8303\u56f4 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/8-2 \u6269\u5c55\u6148\u60b2\u5fc3\u7684\u8303\u56f4 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "08:28",
- "play_times": 1705
- }, {
- "class_id": 32,
- "seesion_id": 3,
- "title": "9-1 \u4e0d\u52a0\u9009\u62e9\u7684\u89c9\u5bdf - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/9-1 \u4e0d\u52a0\u9009\u62e9\u7684\u89c9\u5bdf - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "05:34",
- "play_times": 2096
- }, {
- "class_id": 33,
- "seesion_id": 3,
- "title": "9-2 \u4f11\u61a9\u4e8e\u65e0\u8fb9\u9645\u89c9\u77e5 - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/9-2 \u4f11\u61a9\u4e8e\u65e0\u8fb9\u9645\u89c9\u77e5 - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "10:51",
- "play_times": 3217
- }, {
- "class_id": 34,
- "seesion_id": 3,
- "title": "11-1 \u611f\u6069\u7ec3\u4e60 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/11-1 \u611f\u6069\u7ec3\u4e60 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "05:14",
- "play_times": 2150
- }, {
- "class_id": 35,
- "seesion_id": 3,
- "title": "11-2 \u7ad9\u7acb\u7ec3\u4e60 - \u7ae5\u6167\u7426",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/11-2 \u7ad9\u7acb\u7ec3\u4e60 - \u7ae5\u6167\u7426.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u7ae5\u6167\u7426",
- "duration": "07:18",
- "play_times": 1673
- }, {
- "class_id": 36,
- "seesion_id": 3,
- "title": "12-1 \u732e\u51fa\u6211\u4eec\u7684\u5929\u8d4b - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/12-1 \u732e\u51fa\u6211\u4eec\u7684\u5929\u8d4b - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:02",
- "updated_at": "2016-10-24 00:31:02",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "03:49",
- "play_times": 1952
- }, {
- "class_id": 37,
- "seesion_id": 3,
- "title": "12-2 \u5c06\u6211\u4eec\u7684\u5929\u8d4b\u5e26\u5230\u4e16\u754c\u4e2d\u53bb - \u9648\u5fb7\u4e2d",
- "file_url": "app.cognitiveleap.cn\/Session_Content\/Audio_Files\/Session_3\/12-2 \u5c06\u6211\u4eec\u7684\u5929\u8d4b\u5e26\u5230\u4e16\u754c\u4e2d\u53bb - \u9648\u5fb7\u4e2d.mp3",
- "created_at": "2016-10-24 00:31:03",
- "updated_at": "2016-10-24 00:31:03",
- "author_name": "\u9648\u5fb7\u4e2d",
- "duration": "07:15",
- "play_times": 2202
- }]
- }';
- $datas = json_decode($y,true);
- $path = '/Users/stanley-king/Documents/jz';
- $i = 1;
- foreach ($datas['classes'] as $item)
- {
- $url = "http://{$item['file_url']}";
- $info = pathinfo($url);
- if(empty($info['extension'])) continue;
- $title = "{$i}.{$info['extension']}";
- $file = "{$path}/{$title}";
- $this->download($url,$file);
- $i++;
- }
- }
- private function download($url,$path)
- {
- $info = pathinfo($url);
- if(!file_exists($path)) {
- $pic_url = $info['dirname'] . '/' . str_replace(' ','%20',$info['basename']);
- exec("wget -O $path $pic_url");
- }
- if(file_exists($path))
- {
- if(filesize($path) > 0) {
- return true;
- } else {
- unlink($path);
- return false;
- }
- } else {
- return false;
- }
- }
- public function testPathlog()
- {
- $path_file = BASE_DATA_PATH . '/log/' . date('Ymd', time()) . '_path.log';
- $fd = @fopen($path_file, "r");
- $stdout = fopen('php://stdout', 'w');
- while (!feof($fd))
- {
- $line = fgets($fd,1024);
- if ($line !== false && !empty($line)) {
- fwrite($stdout,"{$line}\n\n");
- }
- }
- fclose($fd);
- }
- public function testMonitor()
- {
- $fd = @fopen(BASE_ROOT_PATH . "/data/log/20180831.log", "c+");
- $stdout = fopen('php://stdout', 'w');
- while (true)
- {
- $line = fread($fd,1024);
- if ($line !== false && !empty($line)) {
- fwrite($stdout,$line);
- }
- else {
- fwrite($stdout,"fread empty line\n");
- usleep(1000000);
- }
- }
- }
- public function testMonitorSelect()
- {
- $fd = @fopen(BASE_ROOT_PATH . "/data/log/20180831.log", "c+");
- $stdout = fopen('php://stdout', 'w');
- while (true)
- {
- $wfds = null;
- $xfds = null;
- $rfds = [$fd];
- $timeout = 2;
- $number = stream_select($rfds, $wfds, $xfds, $timeout, 0);
- if($number > 0)
- {
- if(!empty($rfds))
- {
- $line = fread($fd,1024);
- if ($line !== false && !empty($line)) {
- fwrite($stdout,$line);
- }
- else {
- fwrite($stdout,"fread empty line\n");
- usleep(1000000);
- }
- }
- else {
- fwrite($stdout,"no content to read\n");
- }
- }
- else {
- fwrite($stdout,"ret = {$number}\n");
- }
- fwrite($stdout,"ret = {$number}\n");
- }
- }
- public function testStat()
- {
- $date = date("Ymd");
- $file_name = BASE_DATA_PATH. DS. 'log'. DS. $date. ".log";
- $fd = @fopen($file_name, 'r+');
- $stat_temp = @fstat($fd);
- $size_temp = $stat_temp['size'];
- while (true)
- {
- $stat = @fstat($fd);
- $size_now = $stat['size'];
- if ($size_now != $size_temp) {
- echo "stat now: {$stat}";
- $size_temp = $size_now;
- }
- usleep(1000000);
- }
- }
- public function testMini()
- {
- $from = 'YWN0PWdvb2RzX2NvbW1vbiZvcD1pbmRleCZnb29kc19pZD00NTUwJmNsaWVudF90eXBlPW1pbmk';
- $from = urldecode($from);
- $from = base64_decode($from);
- $x = 'act=goods_common&op=index&goods_id=1234&client_type=mini';
- $x = base64_encode($x);
- $x = urlencode($x);
- }
- }
|