Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
christinaflach committed May 30, 2023
1 parent 5a78576 commit 9731ac7
Show file tree
Hide file tree
Showing 373 changed files with 110,342 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# seed.select
Core forked from FlossSearch.Edu
# About seed.select

seed.select is a fork from flosssearch.

## License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License (GLP) as published by the Free Software Foundation. Information about the GNU General Public License can be found at http://www.gnu.org/licenses/.

---

## About FlossSearch.Edu (2020-v1.0)

The FlossSearch.Edu tool was created to support Instructor and students in the selection of FLOSS projects, hosted on GitHub, for use in teaching software engineering. The tool is in English to facilitate its use by researchers from different countries. The project home page is http://191.252.92.63/flosssearch/

Considering that there is a growing diversity of projects available in software repositories, finding those that have the desired features for integration in the teaching of Software Engineering is not a trivial task. For this purpose, we identified criteria that have been used for project selection and and with this set of criteria helped us to built this tool to assist Instructor and students search for open source projects to be used in their teaching-learning process.

All projects available here are hosted on GitHub website. We used the Open Hub to identify the number of lines of code criteria, and the GitHub API to implement the scripts used for other criteria. Due to GitHub API's limitations, we developed some scripts and ran them using a set of projects from GitHub, but stored the results locally. Therefore, it is worth to mention that when you run Floss Search, you will be referring to our local Database and not getting real-time information directly from GitHub although we update this information about the projects constantly.

### Technologies used in the project

- PHP 5.6 - Codeigniter v3.1.10
- Locastyle version: 3.10.1
- jQuery v3.2.1

### Plugins

- Ion.RangeSlider v2.3.0
- jQuery Tags Input Revisited Plugin

### License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License (GLP) as published by the Free Software Foundation. Information about the GNU General Public License can be found at http://www.gnu.org/licenses/.
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Documents

88 changes: 88 additions & 0 deletions miner/aceitacao_contribuidor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php

// VERIFICAR SE TEM COMO PUXAR OS REPOSITORIOS POR ID OU EM ORDEM SEQUENCIAL PARA NAO PUXAR REPETIDO
// SENAO VERIFICAR SE REPOSITORIO JÁ EXISTE
// OU TRIGGER REALIZAR ESSA AÇÃO

header("Refresh:1");

// multiplas linhas : fetchAll
// uma linha : fetch
// FETCH_ASSOC
// FETCH_OBJ

// PUXAR TODAS AS LABELS
// https://api.github.com/repos/{NOME COMPLETO REPOSITÓRIO}/labels

require_once ("conection.php");

// TRAZ A LISTA DE LINGUAGENS DO BANCO
$sql = $db->query("SELECT SQL_CACHE id, id_repo FROM repositorios ORDER BY analise_aceita_contribuicao ASC LIMIT 1") or die ($link->error);

$repositorio = $sql->fetch(PDO::FETCH_ASSOC);

var_dump($repositorio);
echo "<br/>";

// CONSULTA A API
$url = "https://api.github.com/search/labels?repository_id=".$repositorio['id_repo']."&q=help+wanted+good+first+issue&per_page=100";
$ch = curl_init();

$authToken = 'KEY_GITHUB';
$headr = [
'Accept: application/vnd.github.symmetra-preview+json'
];
$headr[] = 'Authorization:'.$authToken;


curl_setopt($ch, CURLOPT_HTTPHEADER, $headr);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13");

$data = curl_exec($ch);
curl_close($ch);

$obj = json_decode($data);

echo "<pre>";
print_r($obj);
echo "</pre>";

$aceita_contribuicao = 0;

if(isset($obj->items) && !empty($obj->items)){

foreach ($obj->items as $key => $row) {
if (strtolower($row->name) == 'help wanted' || strtolower($row->name) == 'good first issue') {

$aceita_contribuicao = 1;

$stmt = $db->prepare("INSERT INTO labels(id_repositorio, nome, url, color) VALUES (:id_repositorio, :nome, :url, :color)");

$stmt->bindParam(':id_repositorio', $repositorio['id']);
$stmt->bindParam(':nome', $row->name);
$stmt->bindParam(':url', $row->url);
$stmt->bindParam(':color', $row->color);
$stmt->execute();

}
}

}

if ($aceita_contribuicao) {
echo "<br/>LABEL ENCONTRADA!<br/>";
}

date_default_timezone_set('America/Bahia');
$data_analise = date('Y-m-d H:i:s');

// REGISTRA SE O REPOSITÓRIO ACEITA CONTRIBUIÇÃO OU NÃO
$update = $db->prepare("UPDATE repositorios SET aceita_contribuicao = ".$aceita_contribuicao.", analise_aceita_contribuicao = '".$data_analise."' WHERE id = ".$repositorio['id']."");
$update->execute();

unset($db);

echo "FIM DA EXECUÇÃO";
Loading

0 comments on commit 9731ac7

Please sign in to comment.