Hello a tous , j'ai decide de trouver un moyen de recuperer TOUT les epics trades sur ig , a la fois a titre d'informations et pour recherche personelle.
La quantitee est remarquable (au dela de 400000 ) ,
A vrai dire je ne peux meme pas copier le resultat sur le forum sans faire planter firefox ,
et ne passe pas par l'api officielle , egalement pour cause de crash/blacklist server , partant de la methode browse et marketDetails apres une trentaine de tentatives... :musique:
Pour ceux que ca interesse a des fins de developpement ou autres, envoyez moi un mp pour le fichier txt , ou autrement si benoist me donner un acces ftp.
namespace CEpics
{
internal class Program
{
private static void Main(string[] args)
{
XSECURITYTOKEN = ""; //Your X-security-token , found in IG's API companion headers
CST = ""; //Your CST token , found in IG's API companion headers
Output = -"D:\\log.txt"; // Here is the output file path
Task web = new Task(GetThemTask);
web.Start();
Console.WriteLine("Gettings Instruments...");
Console.ReadLine();
}
public static string ID { get; set; }
public static string XSECURITYTOKEN { get; set; }
public static string CST { get; set; }
public static string Output { get; set; }
public static Uri URI { get; set; }
public static List<int> Subcount(string str, string value)
{
if (String.IsNullOrEmpty(value))
throw new ArgumentException("the string to find may not be empty", "value");
List<int> indexes = new List<int>();
for (int index = 0;; index += value.Length)
{
index = str.IndexOf(value, index);
if (index == -1)
return indexes;
indexes.Add(index);
}
}
private static async void GetThemTask()
{
//creates and sets a security cookie for httpclient
HttpClientHandler handler = new HttpClientHandler();
handler.CookieContainer = new CookieContainer();
HttpClient client = new HttpClient(handler);
Uri uri_epics =
new Uri(URI);
handler.CookieContainer.Add(uri_epics,
new Cookie("X-SECURITY-TOKEN", XSECURITYTOKEN));
// Adding a Cookie
handler.CookieContainer.Add(uri_epics,
new Cookie("CST", CST));
//Total range of instrument's index is arbitrarily located between 50k and 500k...using a brute force approach.
for (int i = 95000; i < 500000; i++)
{
ID = i.ToString();
string epic_url =
String.Format(
"/hiearchyid.htm?hierarchyId={0}&epic=&sort=&dir=asc&view=jsonView",
i.ToString()); //+IG DOMAIN here
Uri uri_epic = new Uri(epic_url);
HttpResponseMessage response_epics = await client.GetAsync(uri_epic);
HttpContent content_epics = response_epics.Content;
Message non lupar [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/src/Extension/CoreExtension.php on line 570: strtr(): Ignoring replacement of empty string Benoist Rousseau »
Je te crée un accès FTP aussi rapidement que possible