2 Star 1 Fork 0

诺墨 / Gitee Trending Explore for Alfred Workflow

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
info.plist 4.99 KB
Copy Edit Web IDE Raw Blame History
诺墨 authored 2019-07-09 18:46 . feat: add workflow logic.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>com.gitee.explore.hot</string>
<key>category</key>
<string>辅助工具 Workflows</string>
<key>connections</key>
<dict>
<key>CF957FC1-9E2D-4C99-B408-F17976EE2E2E</key>
<array>
<dict>
<key>destinationuid</key>
<string>99ED4496-DA74-44B8-B8F2-F1B68021CEC5</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>16D18360-669F-4315-AD48-8B9B0BDDEB06</string>
<key>modifiers</key>
<integer>1048576</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>诺墨 / normalcoder</string>
<key>description</key>
<string>码云热门项目列表</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Gitee 码云热门项目</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>autopaste</key>
<false/>
<key>clipboardtext</key>
<string>{query}</string>
<key>transient</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.output.clipboard</string>
<key>uid</key>
<string>99ED4496-DA74-44B8-B8F2-F1B68021CEC5</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>alfredfiltersresults</key>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>127</integer>
<key>keyword</key>
<string>gitee-hot</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<true/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>1</integer>
<key>runningsubtext</key>
<string>正在搜索中...</string>
<key>script</key>
<string>use Alfred\Workflows\Workflow;
use PHPHtmlParser\Dom;
require 'vendor/autoload.php';
function getQuery($query){
switch ($query){
case "d":
return "daily-trending";
case "w":
return "weekly-trending";
default:
return "daily-trending";
}
}
$dom = new Dom;
$host = 'https://gitee.com';
$dom-&gt;loadFromUrl('https://gitee.com/explore');
$trendingBox = $dom-&gt;find(".explore-trending-projects__container");
$trendingList = $trendingBox-&gt;find("div");
$workflow = new Workflow;
$workflow-&gt;variable('','');
$query = getQuery("{query}");
foreach ($trendingList as $singleTrending)
{
if ($singleTrending-&gt;getAttribute("data-tab") == $query){
$singleTrendingList = $singleTrending-&gt;find(".explore-trending-projects__list-item");
foreach ($singleTrendingList as $item)
{
$workflow-&gt;result()-&gt;title($item-&gt;find('a')-&gt;text)
-&gt;subtitle($item-&gt;find('.description')-&gt;text)
-&gt;quicklookurl($host.$item-&gt;find('a')-&gt;href)
-&gt;type('default')
-&gt;arg($host.$item-&gt;find('a')-&gt;href)-&gt;valid(true)
-&gt;icon('icon.png');
}
}
}
echo $workflow-&gt;output();</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
<string></string>
<key>subtext</key>
<string></string>
<key>title</key>
<string>Gitee 热门项目</string>
<key>type</key>
<integer>1</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>CF957FC1-9E2D-4C99-B408-F17976EE2E2E</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>browser</key>
<string></string>
<key>spaces</key>
<string></string>
<key>url</key>
<string>{query}</string>
<key>utf8</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.action.openurl</string>
<key>uid</key>
<string>16D18360-669F-4315-AD48-8B9B0BDDEB06</string>
<key>version</key>
<integer>1</integer>
</dict>
</array>
<key>readme</key>
<string></string>
<key>uidata</key>
<dict>
<key>16D18360-669F-4315-AD48-8B9B0BDDEB06</key>
<dict>
<key>xpos</key>
<integer>290</integer>
<key>ypos</key>
<integer>140</integer>
</dict>
<key>99ED4496-DA74-44B8-B8F2-F1B68021CEC5</key>
<dict>
<key>xpos</key>
<integer>290</integer>
<key>ypos</key>
<integer>10</integer>
</dict>
<key>CF957FC1-9E2D-4C99-B408-F17976EE2E2E</key>
<dict>
<key>xpos</key>
<integer>70</integer>
<key>ypos</key>
<integer>80</integer>
</dict>
</dict>
<key>webaddress</key>
<string>gitee.com/normalcoder</string>
</dict>
</plist>

Comment ( 0 )

Sign in for post a comment

PHP
1
https://gitee.com/normalcoder/Gitee-Trending-Explore-for-Alfred-Workflow.git
git@gitee.com:normalcoder/Gitee-Trending-Explore-for-Alfred-Workflow.git
normalcoder
Gitee-Trending-Explore-for-Alfred-Workflow
Gitee Trending Explore for Alfred Workflow
master

Search