V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Tining
V2EX  ›  PHP

做了一个可以引用到 HTML 页面的 Gitea 日历

  •  
  •   Tining · Feb 2, 2021 · 2624 views
    This topic created in 1911 days ago, the information mentioned may be changed or developed.

    github php-gitea-calendar

    小弟刚入行,如果大哥们觉得能用得上的话希望能给点小星星 qwq

    引用

    第一步

    • 请配置 src/config.php 文件中的 url,格式如下

    #http://{domian}/api/v1/user/{username}/heatmap
    $url = "http://192.168.0.197:7006/api/v1/users/Tining/heatmap";
    

    第二步

    • 请确保您引用了该仓库下的 CSS 文件

    <link rel="stylesheet" href="css/style.css">
    

    第三步

    • 在任意想要输出日历的地方引用 content.php

    include("content.php");
    

    更多样例请参考 src/index.php 文件

    完成!请享用你的 Gitea 日历

    Thanks / 感谢

    这个项目是由 github-calendar 启发的,然而,github-calendar 不支持 Gitea 并且压缩过后的 JavaScript 文件对我来说难以阅读。我需要重写 ajax 通信。可惜的是,Gitea 的接口似乎有跨域问题,为了更快的解决,我决定用后端采纳数据

    我才用的爬虫工具是 php simple dom parse,很好用并且代码简洁.

    最后由衷感谢 Gitea,可以让我孱弱的树莓派拥有一个 Git 仓库。

    最后强调一个,如果要使用 github 的日历,直接使用 github-calendar 就好了,他们那个好棒的。

    3 replies    2021-02-02 13:45:51 +08:00
    Tining
        1
    Tining  
    OP
       Feb 2, 2021
    很抱歉。。因为账号首次发帖,没办法贴图片。。希望大佬们移步这里看一样,(如果满意的话求小星星
    https://github.com/Tining123/php-gitea-calendar
    whywhywhy
        2
    whywhywhy  
       Feb 2, 2021
    不错,加油。
    Tining
        3
    Tining  
    OP
       Feb 2, 2021
    @whywhywhy 感谢大佬!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3302 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 13:27 · PVG 21:27 · LAX 06:27 · JFK 09:27
    ♥ Do have faith in what you're doing.