sundry

Typecho generates WeChat applet through json data

WeChat applet
Applet is a new open ability, developers can quickly develop a small program. Applets can be easily obtained and spread in WeChat, and have excellent use experience.

http://typecho.org/
Download and install on official website
Installation environment requirements

  • PHP 5.4 or above
  • MySQL, PostgreSQL and SQLite database support, and related extensions are installed in PHP
  • CURL extension support
  • Mbstring or iconv extension support

It needs to be set in typecho ssl Fixed link Pseudo static And domain name keep on record Can be used normally.
Recommended ssl Typecho ssl configuration Pseudo static
Background settings

Code from Sunny Blog

  1. <?php
  2. if  ( stripos ( $this ->request->getRequestUri(), 'json')) {
  3.      $arr  =  array ();
  4.      while  ( $this ->next()) {
  5.          $a  =  array ('title' =>  $this ->title, ' date ' =>  $this -> date ->format('Y-m-j  H:i'), 'content' =>  $this ->content, 'categories' =>  $this ->categories, 'tags' =>  $this ->tags);
  6.          $arr [] =  $a ;
  7.     }
  8.      $this ->response->throwJson( array ( "servererror"  =>  "" "status"  => 1,  "message"  =>  $arr ));
  9. }
  10. ?>

Add to the beginning of the typecho header template

  1. usr/themes/default/header.php

You can achieve simple JSON output and API effect.

Recommended: plug-in version (highly customized)

https://github.com/insoxin/typecho-json-miniprogram
 Typecho json miniprogram setting page

On WeChat public platform https://mp.weixin.qq.com/cgi-bin/wx Register the applet, and after the registration, the information can be improved and developed synchronously.

In the background of WeChat applet public platform, select "Settings"=>"Development Settings" to configure "Server Domain Name" and "Business Domain Name", as shown below:

among request The legal domain name must be configured. This parameter ensures that the applet can be sent normally request Request, the program can run. At the same time, this domain name must keep on record

Fill in the basic information of the applet, including name, avatar, introduction and service scope.

After the applet developer binding and development information configuration are completed, the developer can download the developer tools and refer to the development documents for applet development and debugging
Common applet developer tool
Download address of the latest version (1.02.1803210)
Mac link: https://share.weiyun.com/5R8wo2B (Password: K9AJ)
Supplement win64 link win64: https://share.weiyun.com/5NM8qin (Password: YOTl)
my


Code packaging link: https://pan.baidu.com/s/1EFIajj7lNmC4-_V8m_ZN-g (Unapproved)
Modify the following parameters after downloading

  1. export default {
  2.   getDomain: blog.isoyu.com,
  3. GetWebsiteName: Ji Changxin,
  4.   getAboutId: ABOUTID,
  5.   getPayTemplateId: PAYTEMPPLATEID,
  6.   getPageCount: PAGECOUNT,
  7.   getCategoriesID :CATEGORIESID,
  8.   getIndexNav: INDEXNAV,
  9.   getReplayTemplateId: REPLAYTEMPPLATEID,
  10.   getMinAppType: MINAPPTYPE,
  11.   getZanImageUrl: ZANIMAGEURL,
  12.   getIndexListType: INDEXLISTTYPE,
  13.   getLogo: LOGO,
  14.   getPostImageUrl: POSTERIMGURL
  15. }

After completing the development of the applet, submit the code to the WeChat team for review. After the review is passed, it can be released (it cannot be released during the public beta).

Applet Welcome

Add 151 other collected applet source codes (Fri, 13 Apr 2018 14:12:41 GMT)

reminder: The content here requires Comment article Post merge Refresh To view.

fabulous ( fifty-seven )

This article is written by Ji Changxin Author, article address: https://blog.isoyu.com/archives/typecho-json-miniprogram.html
use Knowledge Sharing Attribution 4.0 International License Agreement. Unless the reprint/source is indicated, they are all original or translated by this website. Please sign your name before reprinting. Last editing time: May 2, 2018 at 06:34 p.m

Popular articles

Comments:

94 comments, 0 visitors, 0 bloggers
  1.  tourist
    tourist Published on:

    Morning

  2.  tourist
    tourist Published on:

    Morning Olympics, come to watch

  3.  tourist
    tourist Published on:

    Aaaa

  4.  tourist
    tourist Published on:

    good

  5.  levee
    levee Published on:

    Membranes~

  6.  tourist
    tourist Published on:

    Come and have a look~~~~~~

  7.  tourist
    tourist Published on:

    Take a look

  8.  tourist
    tourist Published on:

    two hundred and twenty-two thousand two hundred and twenty-two trillion and two hundred and twenty-two billion two hundred and twenty-two million two hundred and twenty-two thousand two hundred and twenty-two

  9.  tourist
    tourist Published on:

    Morning

  10.  seaHi
    seaHi Published on:

    Has God planned to release the source code?

  11.  Tourists 213
    Tourists 213 Published on:

    Come and see

  12.  kzeal
    kzeal Published on:

    Morning

  13.  tourist
    tourist Published on:

    Morning

  14.  tourist
    tourist Published on:

    Big guy, this little program is developed. Just configure it?

  15.  tourist
    tourist Published on:

    The plug-in is installed and configured. Access 404

  16.  Quan Na He
    Quan Na He Published on:

    Yes, it's connected to WeChat applet

    •  tourist
      tourist Published on:

      thank
      Ask how to get the content of the article page...

  17.  Tsuasahi
    Tsuasahi Published on:

    Cute new worships the big guy

  18.  tourist
    tourist Published on:

    If you haven't passed the trial, you should send a cock

    •  Ji Changxin
      Ji Changxin Published on:

      Oh

  19.  tourist
    tourist Published on:

    Good article

  20.  tourist
    tourist Published on:

    Baidu disk of applet source code hangs

  21.  Baidu
    Baidu Published on:

    Learn

  22.  tourist
    tourist Published on:

    Morning

  23.  tourist
    tourist Published on:

    Morning

  24.  tourist
    tourist Published on:

    The source code is not put, and this article has been modified and deleted

  25.  SurgorX
    SurgorX Published on:

    Morning

  26.  tourist
    tourist Published on:

    fabulous?

  27.  tourist
    tourist Published on:

    Code Baidu Cloud hangs up

  28.  tourist
    tourist Published on:

    Take a look at the source code

  29.  tourist
    tourist Published on:

    Take a look at the source code

  30.  long-term
    long-term Published on:

    Hello, wp just changed to typecho

  31.  tourist
    tourist Published on:

    Boss, is there a small application end? For sharing.

  32.  Duosi Duojin
    Duosi Duojin Published on:

    Great, but it seems that your small program code has not passed the review and has not been scanned out. I want to give it to myself https://www.nihaowua.com Migrate to the applet, but I'm afraid the audit will not pass

    •  Ji Changxin
      Ji Changxin Published on:

      Just deal with it with json, but is the boss too pornographic

  33.  Jiuyue
    Jiuyue Published on:

    Hello

    •  Ji Changxin
      Ji Changxin Published on:

      September? He?

  34.  tourist
    tourist Published on:

    Good morning, little Ji Ji

    •  Ji Changxin
      Ji Changxin Published on:

      Good morning, boss

  35.  chen
    chen Published on:

    Learn, thank you, boss

  36.  chen
    chen Published on:

    Good article! Support!

    •  Ji Changxin
      Ji Changxin Published on:

      Boss, good domain name

      •  Chen
        Chen Published on:

        What if I said I bought it for six dollars

        •  Ji Changxin
          Ji Changxin Published on:

          Is Big Brother Considering Taking Action/Manual Funny

  37.  swim
    swim Published on:

    Do you cheat IP? Is there a typecho in it?

  38.  Drunken servant
    Drunken servant Published on:

    Which file is a small program of typecho?

  39.  tourist
    tourist Published on:

    It has been refreshed many times, but I still can't see it

  40.  tourist
    tourist Published on:

    Can't be watched.

  41.  Drunken servant
    Drunken servant Published on:

    Plug in enabling failed

    •  Ji Changxin
      Ji Changxin Published on:

      Contact me with attached pictures

      •  Drunken servant
        Drunken servant Published on:

        There is no typecho file at all

  42.  tourist
    tourist Published on:

    Boss, is there a small application end of TYPECHO here?

  43.  Cyril
    Cyril Published on:

    Which is the corresponding Typecho?

    •  v2ex
      v2ex Published on:

      Ask the same question, but I can't find it after turning the pages...

  44.  tourist
    tourist Published on:

    Come to support

  45.  Cyril
    Cyril Published on:

    Why can't I see it after comments

    •  Ji Changxin
      Ji Changxin Published on:

      Refresh

      •  Cyril
        Cyril Published on:

        Well, there was a little delay, thanks for sharing

  46.  null
    null Published on:

    Needed

  47.  V2EX
    V2EX Published on:

    Big Ji Ji, after you bought your big gift package, there is no small program end of this typecho in it

  48.  V2EX
    V2EX Published on:

    Boss, the online disk is invalid, please share. bese

    •  Ji Changxin
      Ji Changxin Published on:

      There is a supplement under the boss

      •  V2EX
        V2EX Published on:

        It's so long below the boss, which one is it

  49.  tourist
    tourist Published on:

    。。。。。。。。

  50.  tourist
    tourist Published on:

    Good article! Support!

  51.  Bean curd
    Bean curd Published on:

    Good article! Support!

  52.  null
    null Published on:

    Good article! Support!

  53.  tourist
    tourist Published on:

    Good article! Support!

  54.  Hello Lu
    Hello Lu Published on:

    Ask for a code package link, it has failed

  55.  tourist
    tourist Published on:

    Ouke's blog applet, but I want to do other applet. Can the blogger help organize, share and share

  56.  Ink gamut
    Ink gamut Published on:

    The code packaging link is gone

  57.  Liu Xiaohuan
    Liu Xiaohuan Published on:

    Baidu Cloud's connection fails, please change to github's

    •  Ji Changxin
      Ji Changxin Published on:

      Wait until the vacation ends

      •  Liu Xiaohuan
        Liu Xiaohuan Published on:

        When will you update Baidu Cloud's link?? The holiday is over

  58.  98K
    98K Published on:

    Successfully built, I hope the blogger can simplify the process and optimize the page (too monotonous)

    •  Chinese robot
      Chinese robot Published on:

      Hello, that Baidu Cloud packaging link has failed, can you send me a copy

  59.  Xifengli Blog
    Xifengli Blog Published on:

    Big guy, this little program is developed. Just configure it?

    •  tourist
      tourist Published on:

      No, I'm trying to make a plug-in. I went to Google and found a partner who has finished the product. I'm going to edit the article again tomorrow

    •  tourist
      tourist Published on:

      Boss, go to bed early

  60.  Ji Changxin
    Ji Changxin Published on:

    This is a comment through WeChat applet

Post reply

[Required]

I am a human?

Please wait three seconds after submission to avoid unsubmission and repetition