مشاهدة النتائج 1 الى 11 من 11
  1. #1

    برمجة عناكب الويب: [ الجزء الثاني ] ماسح صفحات المنتديات




    attachment

    بسم الله الرحمن الرحيم
    السلام عليكم ورحمة الله وبركاته


    شاهدنا في الموضوع السابق أكواد بناء برنامج لمسح الصفحة الرئيسية للمنتدى واستخراج أسماء الأقسام وروابطها وعرضها بطريقة شجرية باستخدام المتحكم TreeView،
    وشاهدنا بطريقة سريعة كيفية إنشاء مشروع جديد وكيفية إضافة ملفات للمشروع وكيفية ربط الأكواد مع بعضها وإنشاء تطبيق ذو واجهة رسومية للمستخدمين.

    في هذا الموضوع سنكمل الأكواد وسنطرح المرحلة الثانية من عمل برنامج البحث الذي تحدثنا عنه في الموضوع الأول،
    وفي هذه المرحلة سنضيف الأكواد التي تقوم بمسح الأقسام بحثاً عن المواضيع،
    ثم سنستعمل تلك الأكواد للبحث داخل الأقسام في مثال بسيط على عمل البرنامج،

    بعد هذه المرحلة يتبقى طرح أكواد الواجهة التطبيقة الكاملة لبرنامج البحث ومتابعة طريقة عملها، وتلك سنتناولها في الموضوع القادم بإذن الله.

    تابعوا معي.. biggrin





  2. ...

  3. #2

    قائمة الفئات




    قائمة الفئات

    سنضيف إلى المشروع المكتبي MAS.ForumScraper فئات جديدة ستكون كما في القائمة التالية
    ولمن فاته الموضوع السابق يستطيع تحميل ملفات الجزء السابق ليتمكن من التابعة.. التحميل من الرابط ()

    - vBThread
    وهي الفئة التي تحوي معلومات المواضيع (من عنوان وروابط ..الخ.) التي سيتم استخراجها.

    - مجموعة فئات بيانات الأحداث لتنظيم عملية البحث، وهذه الفئات هي:
    * ScrapProgressEventArgs
    *PageErrorEventArgs
    * PageLoadingEventArgs

    - VBForumScraper
    وهي الفئة الرئيسية التي تقوم بالبحث.

    كما وضحت في المواضيع السابقة سأقوم بطرح أكواد هذه الفئات وسأترك المجال مفتوحاً لمناقشتها،
    فلا تترددوا بالسؤال عن أي نقطة أو تنبيهي على أي ملاحظة تشاهدونها rambo

    الأكواد في المشاركات القادمة wink













































  4. #3

    الفئة vBThread




    الفئة vBThread

    اختصاراً للوقت والجهد سأدعكم مع الكود وتذكروا أن الموضوع مفتوح لاستفساراتكم rambo

    كود الـ PHP:
    /*
     * vBThread.cs
     * 
     * Copyright (C) 2014 M.A.S <http://www.mexat.com/vb/member.php?u=175841>
     * 
     * LICENSE (MIT License)
     * 
     * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
     * 
     * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     * 
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * */

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace 
    MAS.ForumScraper
    {
        public class 
    vBThread
        
    {
            
    // عنوان الموضوع.
            
    public string Title getset; }

            
    // المنتدى الذي ينتمي له.
            
    public string ParentForum getset; }

            
    // اسم كاتب الموضوع.
            
    public string AuthorName getset; }

            
    // رابط الموضوع.
            
    [System.Xml.Serialization.XmlIgnore]
            public 
    Uri Url getset; }

            
    // رابط ملف كاتب الموضوع.
            
    [System.Xml.Serialization.XmlIgnore]
            public 
    Uri AuthorUrl getset; }

            
    // رابط الموضوع بصيغة نص.
            
    [System.Xml.Serialization.XmlElement("Url")]
            public 
    string UrlAbsoluteUri
            
    {
                
    get { return Url.AbsoluteUri; }
                
    set Url = new Uri(value); }
            }

            
    // رابط ملف كاتب الموضوع بصيغة نص.
            
    [System.Xml.Serialization.XmlElement("AuthorUrl")]
            public 
    string AuthorUrlAbsoluteUri
            
    {
                
    get { return AuthorUrl.AbsoluteUri; }
                
    set AuthorUrl = new Uri(value); }
            }

            public 
    vBThread() { }
            public 
    vBThread(string titleUri urlstring forum ""string author_name ""Uri author_url null)
            {
                
    Title title;
                
    Url url;
                
    ParentForum forum;
                
    AuthorName author_name;
                
    AuthorUrl author_url;
            }
        }

























  5. #4

    فئات بيانات الأحداث (Event Args)




    فئات بيانات الأحداث (Event Args)

    اختصاراً للوقت والجهد سأدعكم مع الأكواد وتذكروا أن الموضوع مفتوح لاستفساراتكم rambo


    ***** الفئة PageLoadingEventArgs *****

    كود الـ PHP:
    /*
     * PageLoadingEventArgs.cs
     * 
     * Copyright (C) 2014 M.A.S <http://www.mexat.com/vb/member.php?u=175841>
     * 
     * LICENSE (MIT License)
     * 
     * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
     * 
     * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     * 
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * */

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace 
    MAS.ForumScraper
    {
        public class 
    PageLoadingEventArgs EventArgs
        
    {
            public 
    Uri PageUri getset; }
        }

    .
    .

    ***** الفئة ScrapProgressEventArgs *****

    كود الـ PHP:
    /*
     * ScrapProgressEventArgs.cs
     * 
     * Copyright (C) 2014 M.A.S <http://www.mexat.com/vb/member.php?u=175841>
     * 
     * LICENSE (MIT License)
     * 
     * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
     * 
     * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     * 
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * */

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace 
    MAS.ForumScraper
    {
        public class 
    ScrapProgressEventArgs EventArgs
        
    {
            public List<
    vBThreadResults getset; }
            public 
    int ParsedPages getset; }
            public 
    Uri PageUrl getset; }
            public 
    string PageTitle getset; }
        }

    .
    .

    ***** الفئة ScrapProgressEventArgs *****

    كود الـ PHP:
    /*
     * PageErrorEventArgs.cs
     * 
     * Copyright (C) 2014 M.A.S <http://www.mexat.com/vb/member.php?u=175841>
     * 
     * LICENSE (MIT License)
     * 
     * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
     * 
     * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     * 
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     * */

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace 
    MAS.ForumScraper
    {
        public class 
    PageErrorEventArgs EventArgs
        
    {
            public 
    Uri PageUri getset; }
            public 
    bool Retry getset; }
            public 
    Exception Error getset; }
        }




  6. #5

    فئة البحث الرئيسية




    فئة البحث الرئيسية

    اختصاراً للوقت والجهد سأدعكم مع الكود وتذكروا أن الموضوع مفتوح لاستفساراتكم rambo
    ولأن عدد الحروف المسوحة لكل مشاركة يجب أن لا تتعدى 1500 حرف لم أتمكن من طرح كود الموضوع مباشرة nervous

    يمكنكم تحميله من الروابط التالية:



  7. #6

    تجربة عملية للكود




    تجربة عملية للكود

    سنستخدم في هذه التجربة المشاريع التي قمنا بإنشاءها في الموضوع السابق،
    صورة للبرنامج الناتج عند مسح المنتدى العام

    attachment


    روابط تحميل الملفات الناتجة بعد تطبيق كل ما في هذا الموضوع:
    لتجربة تشغيل البرنامج تفضلوا
    أرجو المعذرة لأني لم أقم بشرح تفاصيل إنشاء التجربة، والسبب هو أني لم أجد أي متابعة في موضوعي السابق..
    تستطيعون تحميل الأكواد وتجربتها والموضوع مفتوح لاستفساراتكم وملاحظاتكم ^_^


    أنتظركم rambo


    attachment

    شكراً The Lord of Dark على الهدية الجميلة embarrassed e306


    سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت، أستغفرك ربي وأتوب إليك

  8. #7
    السلام عليكم ورحمة الله وبركاتة
    جزاك الله خير اخي ديمون ورحم الله والديك
    درس جميل ابدعت في طرحة . لاتنسى اخي ان الصبر ياتي بنتائج طيبة
    وان شاء الله تجد متابعين لدروس النادرة
    GtK40901

  9. #8

    إقتباس الرسالة الأصلية كتبت بواسطة بن سنان مشاهدة المشاركة
    السلام عليكم ورحمة الله وبركاتة
    جزاك الله خير اخي ديمون ورحم الله والديك
    درس جميل ابدعت في طرحة . لاتنسى اخي ان الصبر ياتي بنتائج طيبة
    وان شاء الله تجد متابعين لدروس النادرة
    وعليكم السلام ورحمة الله وبركاته

    شكراً لك أخي وإياكم يا رب ^_^

    لن يذهب الشرح إلى أي مكان وبإمكان الجميع التعلم والاستفادة من هذه المواضيع في أي وقتِ شاؤوا biggrin

    تحياتي

  10. #9
    كالعادة إبداع رائع

    وطرح يستحق المتابعة

    شكراً لك

    يُمنع تبادل أرقام الهواتف ,البلاك بيري , أو غيْرها من وسائل الاتصال الشخصي بشكل علني في [التواقيع ,المُشاركات , التعليقات]
    أما الإيميلات فتوضع في المكان المخصص لها ضمن بيانات الملف الشخصي .


  11. #10

    أهلاً بك أخي ^_^
    منور embarrassed

  12. #11

بيانات عن الموضوع

الأعضاء الذين يشاهدون هذا الموضوع

عدد زوار الموضوع الآن 1 . (0 عضو و 1 ضيف)

الكلمات الدلالية لهذا الموضوع

المفضلات

collapse_40b قوانين المشاركة

  • غير مصرّح لك بنشر موضوع جديد
  • غير مصرّح بالرد على المواضيع
  • غير مصرّح لك بإرفاق ملفات
  • غير مصرّح لك بتعديل مشاركاتك
  •  

مكسات على ايفون  مكسات على اندرويد  Rss  Facebook  Twitter