Ejemplo n.º 1
0
    public static string ConvertUrlsToDIV(string url)
    {
        WebService.LinkDetails wss = new WebService.LinkDetails();
        WebService             ws  = new WebService();

        wss = ws.GetDetails(url);
        string imgurl = "";

        if (wss.Image != null)
        {
            imgurl = wss.Image.Url;
        }
        else if (wss.Images != null)
        {
            if (wss.Images.Count > 0)
            {
                imgurl = wss.Images[0].Url;
            }
        }

        string sharetxt = "";

        if (wss.Title != null)
        {
            sharetxt += "<br/><span style='font-size:x-large;color:black;font-weight:bold;line-height:30px;'>【" + wss.Title + "】</span>";
        }
        if (wss.Description != null)
        {
            sharetxt += "<br/><span style='font-size:medium;color:black;line-height:27px;'>" + wss.Description + "</span>";
        }



        string res = "";

        res = "<div style='border: 1px solid; border-color: #e5e6e9 #dfe0e4 #d0d1d5; border-radius: 3px;word-break:break-all;width:100%;'><a href='" + wss.Url + "' style='text-decoration:none'>";
        if (imgurl != "")
        {
            if (UrlExists(imgurl))
            {
                res += "<img src='" + imgurl + "' alt='' width='100%' height='200px' border='0'>";
            }
        }
        if (sharetxt != "")
        {
            res += sharetxt;
        }
        res += "</a></div>";



        return(res);
    }
Ejemplo n.º 2
0
    public static void ConvertUrlsToInData(string url)
    {
        WebService.LinkDetails wss = new WebService.LinkDetails();
        WebService             ws  = new WebService();

        wss = ws.GetDetails(url);
        string imgurl = "";

        if (wss.Image != null)
        {
            imgurl = wss.Image.Url;
        }
        else if (wss.Images != null)
        {
            if (wss.Images.Count > 0)
            {
                imgurl = wss.Images[0].Url;
            }
        }
        URL_data urld = new URL_data();

        urld.url = wss.Url;
        if (wss.Title != null)
        {
            urld.title = wss.Title;
        }
        if (wss.Description != null)
        {
            urld.des = wss.Description;
        }

        if (imgurl != "")
        {
            if (UrlExists(imgurl))
            {
                urld.image_url = imgurl;
            }
        }


        GCP_MYSQL gc1    = new GCP_MYSQL();
        string    Query1 = "insert into status_messages_link_info(link,image_url,title,des,update_time)";

        Query1 += " values('" + url + "','" + urld.image_url + "','" + urld.title + "','" + urld.des + "',NOW());";
        string resin1 = gc1.insert_cmd(Query1);
    }
    public static URL_data ConvertUrlsToDIV(string url)
    {
        WebService.LinkDetails wss = new WebService.LinkDetails();
        WebService             ws  = new WebService();

        wss = ws.GetDetails(url);
        string imgurl = "";

        if (wss.Image != null)
        {
            imgurl = wss.Image.Url;
        }
        else if (wss.Images != null)
        {
            if (wss.Images.Count > 0)
            {
                imgurl = wss.Images[0].Url;
            }
        }
        URL_data urld = new URL_data();

        urld.url = url;
        if (wss.Title != null)
        {
            urld.title = wss.Title;
        }
        if (wss.Description != null)
        {
            urld.des = wss.Description;
        }

        if (imgurl != "")
        {
            if (UrlExists(imgurl))
            {
                urld.image_url = imgurl;
            }
        }

        return(urld);
    }