Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts gathering external website data #6

Open
grctest opened this issue Aug 24, 2017 · 9 comments
Open

Scripts gathering external website data #6

grctest opened this issue Aug 24, 2017 · 9 comments

Comments

@grctest
Copy link
Contributor

grctest commented Aug 24, 2017

From @grctest on January 23, 2017 14:5

Could grab:

  • The latest block numbers from the explorers and full node websites.
  • The latest prices from multiple exchanges
  • Steemit content?

We need to change the cross site scripting security though & we shouldn't make the website too slow nor tacky/bulky.

Has to be JS, we don't have access to the underlying web server terminal.

Copied from original issue: grctest/Gridcoin-Site#18

@grctest
Copy link
Contributor Author

grctest commented Aug 24, 2017

From @startailcoon on January 24, 2017 17:24

As soon as I've completed the upgrade of Gridcoinstats I can supply the Gridcoin webpage with API access, trough JS, to the basic functions. This would include functions like latest block number and exchange prices (gathered by gridcoinstats).

Timeframe: 1-2 months

@grctest
Copy link
Contributor Author

grctest commented Aug 24, 2017

From @startailcoon on June 27, 2017 19:14

Two Public functions that can be used for the webpage for latest Projects status, Active (whitelisted) or Inactive and latest Block information on the chain.

Latest Projects Data: https://www.gridcoinstats.eu/API/api.php?a=getProjectData

Data: Array(
 "active"=>Array(name=>string, url=>string, lastActive=>date),
 "inactive"=>Array(name=>string, url=>string, lastActive=>date)
)

Latest Block Data: https://www.gridcoinstats.eu/API/api.php?a=getLastBlock
Data: Array(id=>string, hash=>string, blockTime=>date, blockDiff=>double, totalBlockMinted=>double)

@grctest
Copy link
Contributor Author

grctest commented Aug 24, 2017

From @startailcoon on June 27, 2017 19:16

Coinmarketcap has a public API for grabbing the latest price feed for Gridcoin.
https://api.coinmarketcap.com/v1/ticker/gridcoin/

[
    {
        "id": "gridcoin", 
        "name": "GridCoin", 
        "symbol": "GRC", 
        "rank": "92", 
        "price_usd": "0.0571596", 
        "price_btc": "0.00002416", 
        "24h_volume_usd": "486330.0", 
        "market_cap_usd": "22310121.0", 
        "available_supply": "390312753.0", 
        "total_supply": "390312753.0", 
        "percent_change_1h": "4.06", 
        "percent_change_24h": "-2.65", 
        "percent_change_7d": "-31.33", 
        "last_updated": "1498590012"
    }
]

@grctest
Copy link
Contributor Author

grctest commented Aug 24, 2017

From @startailcoon on June 27, 2017 19:23

Sample code to get this working with jQuery

    function loadBlocksData() {
      var request = $.ajax({
        url:'https://www.gridcoinstats.eu/API/api.php?a=getLastBlock',
        crossDomain: true,
        dataType: 'json',
      });
      request.done(function(data) {
        $('#blockDataDiv').append('Block ID: ' + data['id'] + ', Block Hash: ' + data['hash'] + ', Time: ' + data['blockTime']);
      });
    }

$(document).ready(function() {
     loadBlockHeaders();
});

@grctest
Copy link
Contributor Author

grctest commented Aug 24, 2017

This issue has arisen again regarding the slack invite portal being added to the gridcoin website.

@grctest
Copy link
Contributor Author

grctest commented Aug 24, 2017

From @barton2526 on August 16, 2017 1:41

I can change the cross site scripting file to accommodate these and the slack scripts.

@grctest
Copy link
Contributor Author

grctest commented Aug 24, 2017

Current XSS policy:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
    <!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->

    <!-- Most restrictive policy: -->
    <site-control permitted-cross-domain-policies="none"/>

    <!-- Least restrictive policy: -->
    <!--
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*" to-ports="*" secure="false"/>
    <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
    -->
</cross-domain-policy>

We can work with Rob to get this changed.

@grctest
Copy link
Contributor Author

grctest commented Aug 31, 2017

What scripts would people actually want implemented on the Gridcoin website?

barton2526 added a commit that referenced this issue Jan 23, 2018
barton2526 pushed a commit that referenced this issue May 21, 2019
@barton2526
Copy link
Member

With #175 we have our first external script pulling data into the site!

nathanielcwm pushed a commit to nathanielcwm/Gridcoin-Site that referenced this issue Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants