Programmer naomba msaada wenu

X-Codee

Member
May 15, 2017
26
43
Nimekua natamani kujua facebook wanatumia tools gani kuchukua post heading na picha, pale tunaposhare link (tunapo copy link ya website au blog nakuiweka facebook)

Sisi tuna weka link tu, wao wanaleta picha, post heading na url ya website hapo ndo nataka jua wanafanyaje.
IMG_20170517_195557.jpg



Napenda kujua maujanja gani wanatumia.

Angalia mfano hapa chini. Naomba technical answers plz au hata kama una mawazo ya tools au library inayoweza nisaidia fanya kitu kama hicho.
 
Facebook wanatumia PHP, Ajax na java so kwa swali lako hapo ajax inahusika sana kufetch data from servers bila kurefresh URL pia Google wanaitumia sana kwenye search engine yao. So nakushauri ujifunze ajax utapata maujanja mengi
 
Nianachojua ku interact na server yamtu nimpaka upewe parmission yaku fetch izo data, nilikuwa nawaza kama wanafanya Scrapping flani ivi ila sina uhakika,

Pili ajax si ina interact between front- end na back- end ndani ya web husika, asa hayo mambo yakufetch external data toka web za nje itahusikaje? Plz naomba elekezwa .

Thanks kwa comment mdau hapo juu
 
Kwenye web zakawaida ukiweka link it just turn blue and underlined, how are they achive this ndo kaukakasi apo? Au mnatumia nini wadau
 
Sina hakika wanafanya vipi lakini nnachojua ni kwamba inategemea na content za page/post husika, sio kila link italeta picha. Kwenye wordpress kwa mfano ukiandika post unachagua featured image ambayo inakuwa indexed na post. Kwaiyo kama ukishare link ile featured image inatokea na huu ndio utaratibu unaotumiwa na bloggers pamoja na news site nyingi.

Angalia mifano hii:
TvKEfqu.png



Na hii kutoka wikipedia

7czQ58x.png


lakini angalia hii kutoka tamisemi

Is1Ml1P.png


Hii ya tamisemi haijaleta picha ingawa kuna picha sababu ya uandishi mbovu unaoambatana na udhaifu katika seo

hope this helps.
 
I think following steps are involved

  • Using Javascript find the links in the written text
  • From the found links get the last link in the text (FB shows only for last link)
  • Using AJAX send this link detail to a server side page (PHP/ASP/JSP etc.)
  • The server side page gets the required data (from Meta tags) including
    • Title (Preferably Open graph og:title if missing from <title>
    • Description (Preferably Open graph og:description if missing from <meta name="description" ....
    • Images (Preferably Open graph og:image if missing from <img src=....
  • In PHP you can get these datas either using curl or file_get_contents and parse for required data detailed above. Not sure about other Language.
  • Show the result thus found in the AJAX request.
Additionally I think FB stores the data, once found, in database and 1st queries there. This helps them to get faster result and hence same article shared and liked generate the image and details from the stored data.

You will need Javascript to show this preview in runtime (while you write in the textarea). However if you only need it after posting of data it can be done with pure server side language (you can avoid javascript) and following above steps just remove AJAX call.

Source: How Facebook link preview happens?

Ni post ya muda kidogo ila mwanga utaupata
 
Umefanya utafuti mzuri sana, nimepenyezewa na mtu apa kua bloggers picha zinakua ivo coz mnapo andika post kwenye blog, mna specify title, image na body.

So inaezakuwa is phantomJs tool inatumika ku scrapp izo data kwa kuangalia heading ni ipi napicha ni ipi, mawaza yamdau mmoja. Nimeona niweka hapa
 
Asanteni sana wadau napata mwanga aides, Nyasiro hongera kwa utafiti, mr stefano thanks sana
 
Nimepata mwanga, nikitulia naeza implement.

Ila mjadala unazidi kukua kuna hii site inaitwa Feedly feedly: organize, read and share what matters to you.

Hawa wanachukua feed url pekee, ila output inayotoka ni kama post za facebook, yani wana fetch image, title na url . asa hawa wanafanyaje automatotic.

Facebook unaeka mwenyewe link ila hawa unaeka feed url basi ina scan yenyewe hapa pamekaaje watu wa wordpress na blogs mnisaidie asee
 
(RSS) Feed URL inacontain XML ambayo inaelezea kila post kwenye hiyo Blog au site ikoje eo Title, Description, URL, Picha etc so wanasoma hiyo XML na kuparse details zote kama kuna picha wanazidownload katika server zao kisha wanakuonyesha wewe katika App.

Jaribu kufungua hiyo feed URl kwenye browser utaona XML.

Facebook wanachukua URL uliyoweka wanaidownload na kuiparse kwenye server zao kisha wanachukua wanachofikiri ni relevant wanaweka kwenye post.
 
(RSS) Feed URL inacontain XML ambayo inaelezea kila post kwenye hiyo Blog au site ikoje eo Title, Description, URL, Picha etc so wanasoma hiyo XML na kuparse details zote kama kuna picha wanazidownload katika server zao kisha wanakuonyesha wewe katika App.

Jaribu kufungua hiyo feed URl kwenye browser utaona XML.

Facebook wanachukua URL uliyoweka wanaidownload na kuiparse kwenye server zao kisha wanachukua wanachofikiri ni relevant wanaweka kwenye post.
Kiongozi, umetisha sana, nina option tatu zakuondika hii kitu, Python, java na php lang ipi itanipa perfomance nzuri na best output.

Php siipendi ipo slow nadhani jamii forum wanatumia php coz updates za info na notification zipo slow mbaya. Plz ur recommendation Sir
 
Mawazo yawadau wengine yanaruhusiwa piah,
Language poah kuandika program inayosoma rss feeds, kama Feedly
 
Thanks kwa michango nimeshafanya maamuzi teyari.

Nitatumia Rome library ROME - Home

Ambayo ni java library

Language ni issue kwa ajili ya parfomance kiongozi

Python wana library poah feedparser na nyingne imekuja na framework ya django nifresh ila problem with me mahaba yangu na kikombe cha coffee (java)ndo yananitesa japo hosting cost zipo juu (sizanchi hii)

Php wanayo library simplepie ila php is out of trend now haina future.

Thanks wadau wote.
 
Lol eti php haina future, hadithi ya miaka kama 10 hiyo haijawahi kutimia. Performance ya language sio issue kwenye system ya namna hii, muda mwingi utatumika kwenye network yaani hii system ni network bound time ya kuexecute hiyo code ni practically irrelevant.

Programmer wapya always wanaishia kuhangaika kutafuta best tool, best db, best framework badala ya kujenga system. Jenga system ukikutana na limitations utadeal nazo huko huko mbele.
 
Kwenye web zakawaida ukiweka link it just turn blue and underlined, how are they achive this ndo kaukakasi apo? Au mnatumia nini wadau
Kwakutumia php Au javascript unaweza ku regx url na kuibadilisha rangi so it very simple that way.( pre_replace(),regx().
 
Back
Top Bottom